Gomobile broken on Xcode 14?

197 views
Skip to first unread message

Scotty Davenport

unread,
Jul 4, 2023, 5:35:02 PM7/4/23
to golang-nuts
Dear Go Authors,

I'm attempting to use gomobile to build an .xcframework to use inside an iOS application.

MacOS: 13.4.1
Xcode: 14.3.1 (reproduced with 15.0 beta as well)
Gomobile: go install golang.org/x/mobile/cmd/gomobile@latest (as of now)

Unfortunately, when running `gomobile bind -v -target=ios/arm64 -work ./` results in:
```
error: unable to find any architecture information in the binary at '/var/folders/fq/xblf5xd142j8nqnjg4mv3h2c0000gn/T/gomobile-work-45615641/ios/iphoneos/Demo.framework/Demo': Unknown header: 0x51000000
```

This error happens during an invocation to `xcodebuild -create-xcframework`:
```
error: unable to find any architecture information in the binary at '/var/folders/fq/xblf5xd142j8nqnjg4mv3h2c0000gn/T/gomobile-work-1490899078/ios/iphoneos/Demo.framework/Demo': Unknown header: 0x51000000
```

Any clue on how to debug this is appreciated. Also, let me know if I can provide more evidence/information.

Attachments:
* core.go: minimal source
* invocation.txt: verbose invocation to gomobile

```
file Demo.framework/Demo

Demo.framework/Demo: Mach-O universal binary with 1 architecture: [arm64:current ar archive]
/var/folders/fq/xblf5xd142j8nqnjg4mv3h2c0000gn/T/gomobile-work-1490899078/ios/iphoneos/Demo.framework/Demo (for architecture arm64):    current ar archive
```


core.go
invocation.txt

Scotty Davenport

unread,
Jul 4, 2023, 6:17:42 PM7/4/23
to golang-nuts
For a quick repro, I think it's worth noting that:

This does not work:
gomobile bind -target=ios golang.org/x/mobile/example/bind/hello

while this does:
gomobile build -target=ios -bundleid=com.example golang.org/x/mobile/example/basic
Reply all
Reply to author
Forward
0 new messages