Skip to content

M1 iOS simulator app fails to build with with google_sign_in plugin: ld: framework not found Pods_Runner Undefined symbols for architecture x86_64 #94914

@hongfeiyang

Description

@hongfeiyang

Steps to Reproduce

Upgrade existing projects on M1 Macs, then try to build the iOS target, flutter will throw errors with generatedplugincontraints.h module not found error.
initially this was with cloud_fire_store, then I removed firebase from the app, and it is throwing the same error with device info.
So for whatever packages, if it is listed as the first package in the generatedpluginconstraint.h file, I will get this module not found issue.

I even tried deleting the whole iOS folder, and regenerate it with flutter create ., same issue.

I tried to build the same project on an intel based app with Flutter 2.8.0, works perfectly fine.

I tried to build the macOS target on M1 Macs with Flutter 2.8.0, works fine too.

I then rolled back to version 2.5.3 on M1 Macs, build the iOS target for same project, works perfectly fine as well.

So at this point I think it maybe a Flutter bug itself, whenever I have a native side plugin in my project it will not compile the iOS target on Apple Silicon Macs.

Expected results:

Actual results:

Code sample
Logs
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.8.0, on macOS 12.0.1 21A559 darwin-arm, locale en-AU)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.2.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.2.3)
[✓] VS Code (version 1.63.0)
[✓] Connected device (3 available)

• No issues found!
Running "flutter pub get" in upstreet_mobile_app...
Launching lib/main.dart on iPhone 13 in debug mode...
Xcode build done.                                           19.1s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
Xcode's output:
↳
    ld: warning: ignoring file /Users/hongfeiyang/upstreet/upstreet_mobile_app/build/ios/Debug-iphonesimulator/AppAuth/AppAuth.framework/AppAuth, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64
    ld: warning: ignoring file /Users/hongfeiyang/upstreet/upstreet_mobile_app/build/ios/Debug-iphonesimulator/GTMAppAuth/GTMAppAuth.framework/GTMAppAuth, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64
    ld: warning: ignoring file /Users/hongfeiyang/upstreet/upstreet_mobile_app/build/ios/Debug-iphonesimulator/GTMSessionFetcher/GTMSessionFetcher.framework/GTMSessionFetcher, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64
    Undefined symbols for architecture x86_64:
      "_OBJC_CLASS_$_GTMOAuth2KeychainCompatibility", referenced from:
          objc-class-ref in GoogleSignIn(GIDAuthStateMigration_bdf842e92d17b12b5f020e0e721bd017.o)
      "_OBJC_CLASS_$_OIDURLQueryComponent", referenced from:
          objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
      "_OBJC_CLASS_$_OIDServiceConfiguration", referenced from:
          objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
      "_OIDResponseTypeCode", referenced from:
          -[GIDSignIn authenticateInteractivelyWithOptions:] in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
      "_OBJC_CLASS_$_OIDAuthorizationService", referenced from:
          objc-class-ref in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
          objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
      "_OBJC_CLASS_$_GTMSessionFetcher", referenced from:
          objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
      "_OBJC_CLASS_$_OIDAuthorizationRequest", referenced from:
          objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
      "_OBJC_CLASS_$_GTMAppAuthFetcherAuthorization", referenced from:
          _OBJC_CLASS_$_GTMAppAuthFetcherAuthorizationWithEMMSupport in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
          objc-class-ref in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
          objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
          objc-class-ref in GoogleSignIn(GIDAuthStateMigration_bdf842e92d17b12b5f020e0e721bd017.o)
         (maybe you meant: _OBJC_CLASS_$_GTMAppAuthFetcherAuthorizationWithEMMSupport, _OBJC_CLASS_$_GTMAppAuthFetcherAuthorizationEMMChainedDelegate )
      "_OIDOAuthTokenErrorDomain", referenced from:
          ___46-[GIDAuthentication refreshTokensWithHandler:]_block_invoke in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
      "_OBJC_CLASS_$_OIDIDToken", referenced from:
          objc-class-ref in GoogleSignIn(GIDGoogleUser_2bdd4a676c033bc6ca21970e75d9159c.o)
          objc-class-ref in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
          objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
      "_OBJC_METACLASS_$_GTMAppAuthFetcherAuthorization", referenced from:
          _OBJC_METACLASS_$_GTMAppAuthFetcherAuthorizationWithEMMSupport in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
         (maybe you meant: _OBJC_METACLASS_$_GTMAppAuthFetcherAuthorizationWithEMMSupport, _OBJC_METACLASS_$_GTMAppAuthFetcherAuthorizationEMMChainedDelegate )
      "_OIDOAuthErrorResponseErrorKey", referenced from:
          +[GIDAuthentication handleTokenFetchEMMError:completion:] in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
      "_OBJC_CLASS_$_GTMKeychain", referenced from:
          objc-class-ref in GoogleSignIn(GIDAuthStateMigration_bdf842e92d17b12b5f020e0e721bd017.o)
      "_OBJC_CLASS_$_OIDAuthState", referenced from:
          objc-class-ref in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
          objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in parallel
    /Users/hongfeiyang/upstreet/upstreet_mobile_app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'AppAuth' from project 'Pods')
    /Users/hongfeiyang/upstreet/upstreet_mobile_app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'GoogleSignIn' from project 'Pods')
Could not build the application for the simulator.
Error launching application on iPhone 13.
Exited (sigterm)

Metadata

Metadata

Assignees

Labels

P0Critical issues such as a build break or regressionc: crashStack traces logged to the consolec: regressionIt was better in the past than it is nowfound in release: 2.6Found to occur in 2.6found in release: 2.8Found to occur in 2.8has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-host-armBuilding on an ARM-based platformplatform-iosiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versiontoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions