google / GoogleSignIn-iOS

Enables iOS and macOS apps to sign in with Google.
https://developers.google.com/identity/sign-in/ios
Apache License 2.0
506 stars 201 forks source link

App crashes when linking to framework target in Xcode using GoogleSignIn Package via SPM #296

Closed simondelphia closed 1 year ago

simondelphia commented 1 year ago

Describe the bug My project has a main app target and a few internal frameworks which modularize the code, all in the same project/repo. I am using GoogleSignIn inside one of these frameworks, called "Account", and only inside this framework. So I added the latest version of the package using Swift Package Manager and linked it inside the "Link Binary With Libraries" section of the settings for my Account framework target. This compiles fine in debug but the app crashes immediately when opened if I build a release version (e.g. for TestFlight) or if I run it on "My Mac (designed for iPhone)".

I am seeing a lot of errors in the run log in Xcode like:

dyld[57213]: Library not loaded: @rpath/GTMSessionFetcherCore_7C12F63883B5F82B_PackageProduct.framework/GTMSessionFetcherCore_7C12F63883B5F82B_PackageProduct not valid for use in process: Trying to load an unsigned library no such file, not in dyld cache

I see GTMSessionFetcher is a dependency for GoogleSignIn, but we also already have this package installed because of Firebase. I don't know why it's singling out this dependency specifically.

This issue is very likely something related more to my setup than a bug with this package, but I'm fairly stuck at this point and was hoping someone could provide some guidance.

To Reproduce Steps to reproduce the behavior:

  1. Add GoogleSignIn Swift Package to project
  2. Link GoogleSignIn package to framework target in Xcode
  3. Run app from Xcode on "My Mac (designed for IPhone)"

Currently creating a new project to see if I can reproduce it at all. EDIT: Basic setup seems to be fine, though my actual project has several framework modules and links several other packages etc.

Expected behavior No crashing in release builds

Environment

mdmathias commented 1 year ago

@simondelphia is this still an issue for you? I'm not able to reproduce locally with one of our sample apps. If it is still impacting you, could you share more about your setup? For example, could you share your Package.swift?

mdmathias commented 1 year ago

I'm closing this as not reproducible given the lack of activity. Please reopen this issue if the problem still exists.