Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/mobile: gomobile [suggested fix provided] not working with Xcode 15.3 due to missing Info.plist via SPM #67000

Open
g3devv opened this issue Apr 23, 2024 · 3 comments
Labels
mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@g3devv
Copy link

g3devv commented Apr 23, 2024

Go version

go version go1.21.4 darwin/arm64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/Meme/Library/Caches/go-build'
GOENV='/Users/Meme/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/Meme/go/pkg/mod'
GOOS='darwin'
GOPATH='/Users/Meme/go'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.21.4'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/w0/123_/T/go-build1234_=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

I ran my iOS app that has a gomobile compiled framework as an SPM dependency.

Example project to reproduce the issue: github.com/g3devv/gomobile-plist-demo

What did you see happen?

#66500 and #66018 is not entirely solved yet, Xcode still complains with the following output:

App installation failed: Unable to Install “pl0”

Please try again later. Failed to load Info.plist from bundle at path /Users/Meme/Library/Developer/CoreSimulator/Devices/123-456/data/Library/Caches/com.apple.mobile.installd.staging/temp.XTabc/extracted/Payload/pl0.app/Frameworks/Plexample.framework; Extra info about "/Users/Meme/Library/Developer/CoreSimulator/Devices/123-456/data/Library/Caches/com.apple.mobile.installd.staging/temp.XTabc/extracted/Payload/pl0.app/Frameworks/Plexample.framework/Info.plist": Couldn't stat /Users/Meme/Library/Developer/CoreSimulator/Devices/123-456/data/Library/Caches/com.apple.mobile.installd.staging/temp.XTabc/extracted/Payload/pl0.app/Frameworks/Plexample.framework/Info.plist: No such file or directory

What did you expect to see?

Because gomobile now adds the Info.plist files I expected everything to work again. Tree from my gomobile output:

gomobile-plist-demo/plexampleSPM/Frameworks
└── plexample.xcframework
    ├── Info.plist
    ├── ios-arm64
    │   └── Plexample.framework
    │       ├── Headers -> Versions/Current/Headers
    │       ├── Modules -> Versions/Current/Modules
    │       ├── Plexample -> Versions/Current/Plexample
    │       ├── Resources -> Versions/Current/Resources
    │       └── Versions
    │           ├── A
    │           │   ├── Headers
    │           │   │   ├── Plexample.h
    │           │   │   ├── Plexample.objc.h
    │           │   │   ├── Universe.objc.h
    │           │   │   └── ref.h
    │           │   ├── Modules
    │           │   │   └── module.modulemap
    │           │   ├── Plexample
    │           │   └── Resources
    │           │       └── Info.plist
    │           └── Current -> A
    └── ios-arm64_x86_64-simulator
        └── Plexample.framework
            ├── Headers -> Versions/Current/Headers
            ├── Modules -> Versions/Current/Modules
            ├── Plexample -> Versions/Current/Plexample
            ├── Resources -> Versions/Current/Resources
            └── Versions
                ├── A
                │   ├── Headers
                │   │   ├── Plexample.h
                │   │   ├── Plexample.objc.h
                │   │   ├── Universe.objc.h
                │   │   └── ref.h
                │   ├── Modules
                │   │   └── module.modulemap
                │   ├── Plexample
                │   └── Resources
                │       └── Info.plist
                └── Current -> A

(It has Info.plist in 3 places for 2 architectures)

Tree for my framework in the Derived Data:

Plexample.framework/
├── Headers -> Versions/Current/Headers
├── Modules -> Versions/Current/Modules
├── Plexample -> Versions/Current/Plexample
├── Resources -> Versions/Current/Resources
└── Versions
    ├── A
    │   ├── Headers
    │   │   ├── Plexample.h
    │   │   ├── Plexample.objc.h
    │   │   ├── Universe.objc.h
    │   │   └── ref.h
    │   ├── Modules
    │   │   └── module.modulemap
    │   ├── Plexample
    │   └── Resources
    │       └── Info.plist
    └── Current -> A

10 directories, 8 files

(It has no Info.plist in the root in case that matters)

@seankhliao seankhliao changed the title gomobile (demo project included) not working with Xcode 15.3 due to missing Info.plist via SPM x/mobile: gomobile (demo project included) not working with Xcode 15.3 due to missing Info.plist via SPM Apr 23, 2024
@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Apr 23, 2024
@gopherbot gopherbot added this to the Unreleased milestone Apr 23, 2024
@g3devv
Copy link
Author

g3devv commented Apr 23, 2024

Adding to this, if I manually add the Info.plist to the Plexample.framework folder (where Xcode seems to expect it according to the error message and also where GoogleMobileAds has put it) it actually does show up in the derived data but I then get:

Please try again later. Failed to load Info.plist from bundle at path /Users/Meme/Library/Developer/CoreSimulator/Devices/123-456/data/Library/Caches/com.apple.mobile.installd.staging/temp.abc/extracted/Payload/pl0.app/Frameworks/Plexample.framework; Extra info about "/Users/Meme/Library/Developer/CoreSimulator/Devices/123-456/data/Library/Caches/com.apple.mobile.installd.staging/temp.abc/extracted/Payload/pl0.app/Frameworks/Plexample.framework/Info.plist": dev=16777234 ino=96894730 mode=0100644 nlink=1 uid=501 gid=20 rdev=0 size=212 atime=1713903777.230342 mtime=1713903777.179036 ctime=1713903777.410030 birthtime=1713903777.179036 blksize=4096 blocks=8 flags=0x0 firstBytes={length = 4, bytes = 0x3c3f786d} ACL=<not found> extendedAttributes=<not found> keyCount=0 

The error message doesn't indicate what's wrong with the new Plist tho

@g3devv
Copy link
Author

g3devv commented Apr 23, 2024

Good news! After 8 hours and an unprecedented physical headache building up I think I have a solution now. I previously tried to use the GoogleMobileAds plist but I only replaced it on either plist which threw this error above. If I put the GoogleMobileAds Info.plist in

Plexample.framework/ + replace the Plist that gomobile generates, and then replace the key/string for:

	<key>CFBundleExecutable</key>
	<string>Plexample</string>

it finally runs the app again. I don't know if I'm allowed to share the file directly here but it's the one at

googleads/swift-package-manager-google-mobile-ads@5ff9772

So basically it looks like gomobile's fault is that the plist is empty, if we fill it with actual data it works. 🎉🥳

If I have permission to post the google plist here I can show a fully working example if it helps you

@jimwei
Copy link

jimwei commented Apr 24, 2024 via email

@g3devv g3devv changed the title x/mobile: gomobile (demo project included) not working with Xcode 15.3 due to missing Info.plist via SPM x/mobile: gomobile [suggested fix provided] not working with Xcode 15.3 due to missing Info.plist via SPM Apr 24, 2024
@joedian joedian added NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants