title: Flutter - google_sign_in building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64
body: <p>I'm trying to run my <code>auth-sample</code> project with the <code>google_sign_in</code> flutter plugin, but it won't compile.</p>
  <p>This is the error I am facing:</p>
  <pre><code>Launching lib/main.dart on iPhone 12 in debug mode...
  Running pod install...
  Running Xcode build...
  Xcode build done.                                           10.9s
  Failed to build iOS app
  Error output from Xcode build:
  ↳
      objc[43499]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1fafd6b90) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1066b82c8). One of the two will be used. Which one is undefined.
      objc[43499]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x1fafd6be0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1066b8318). One of the two will be used. Which one is undefined.
      ** BUILD FAILED **
  
  
  Xcode's output:
  ↳
      ld: warning: ignoring file /Users/myuser/Projects/test/auth_sample/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/myuser/Projects/test/auth_sample/build/ios/Debug-iphonesimulator/PromisesObjC/FBLPromises.framework/FBLPromises, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64
      ld: warning: ignoring file /Users/myuser/Projects/test/auth_sample/build/ios/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework/FirebaseAuth, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64
      ld: warning: ignoring file /Users/myuser/Projects/test/auth_sample/build/ios/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework/FirebaseCore, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64
      ld: warning: ignoring file /Users/myuser/Projects/test/auth_sample/build/ios/Debug-iphonesimulator/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework/FirebaseCoreDiagnostics, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64
      ld: warning: ignoring file /Users/myuser/Projects/test/auth_sample/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
      ld: warning: ignoring file /Users/myuser/Projects/test/auth_sample/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/myuser/Projects/test/auth_sample/build/ios/Debug-iphonesimulator/GoogleDataTransport/GoogleDataTransport.framework/GoogleDataTransport, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64
      ld: warning: ignoring file /Users/myuser/Projects/test/auth_sample/build/ios/Debug-iphonesimulator/GoogleUtilities/GoogleUtilities.framework/GoogleUtilities, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64
      ld: warning: ignoring file /Users/myuser/Projects/test/auth_sample/build/ios/Debug-iphonesimulator/firebase_auth/firebase_auth.framework/firebase_auth, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64
      ld: warning: ignoring file /Users/myuser/Projects/test/auth_sample/build/ios/Debug-iphonesimulator/firebase_core/firebase_core.framework/firebase_core, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64
      ld: warning: ignoring file /Users/myuser/Projects/test/auth_sample/build/ios/Debug-iphonesimulator/Pods_Runner.framework/Pods_Runner, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64
      ld: warning: ignoring file /Users/myuser/Projects/test/auth_sample/build/ios/Debug-iphonesimulator/nanopb/nanopb.framework/nanopb, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64
      Undefined symbols for architecture x86_64:
        &quot;_OBJC_CLASS_$_GTMOAuth2KeychainCompatibility&quot;, referenced from:
            objc-class-ref in GoogleSignIn(GIDAuthStateMigration_bdf842e92d17b12b5f020e0e721bd017.o)
        &quot;_OBJC_CLASS_$_OIDURLQueryComponent&quot;, referenced from:
            objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
        &quot;_OBJC_CLASS_$_GTMSessionFetcher&quot;, referenced from:
            objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
        &quot;_OBJC_CLASS_$_OIDServiceConfiguration&quot;, referenced from:
            objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
        &quot;_OIDResponseTypeCode&quot;, referenced from:
            -[GIDSignIn authenticateInteractivelyWithOptions:] in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
        &quot;_OBJC_CLASS_$_OIDAuthorizationService&quot;, referenced from:
            objc-class-ref in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
            objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
        &quot;_OIDOAuthErrorResponseErrorKey&quot;, referenced from:
            +[GIDAuthentication handleTokenFetchEMMError:completion:] in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
        &quot;_OBJC_CLASS_$_OIDIDToken&quot;, 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)
        &quot;_OBJC_METACLASS_$_GTMAppAuthFetcherAuthorization&quot;, referenced from:
            _OBJC_METACLASS_$_GTMAppAuthFetcherAuthorizationWithEMMSupport in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
           (maybe you meant: _OBJC_METACLASS_$_GTMAppAuthFetcherAuthorizationEMMChainedDelegate, _OBJC_METACLASS_$_GTMAppAuthFetcherAuthorizationWithEMMSupport )
        &quot;_OBJC_CLASS_$_GTMAppAuthFetcherAuthorization&quot;, 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_$_GTMAppAuthFetcherAuthorizationEMMChainedDelegate, _OBJC_CLASS_$_GTMAppAuthFetcherAuthorizationWithEMMSupport )
        &quot;_OIDOAuthTokenErrorDomain&quot;, referenced from:
            ___46-[GIDAuthentication refreshTokensWithHandler:]_block_invoke in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
        &quot;_OBJC_CLASS_$_GTMKeychain&quot;, referenced from:
            objc-class-ref in GoogleSignIn(GIDAuthStateMigration_bdf842e92d17b12b5f020e0e721bd017.o)
        &quot;_OBJC_CLASS_$_OIDAuthState&quot;, referenced from:
            objc-class-ref in GoogleSignIn(GIDAuthentication_7b83cc27af8929ec7e4c9760d73a0f31.o)
            objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
        &quot;_OBJC_CLASS_$_OIDAuthorizationRequest&quot;, referenced from:
            objc-class-ref in GoogleSignIn(GIDSignIn_f05654be6d1b2af59ab6df426a0c4eb9.o)
        &quot;_OBJC_CLASS_$_FLTFirebaseCorePlugin&quot;, referenced from:
            objc-class-ref in GeneratedPluginRegistrant.o
        &quot;_OBJC_CLASS_$_FLTFirebaseAuthPlugin&quot;, referenced from:
            objc-class-ref in GeneratedPluginRegistrant.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 dependency order
      /Users/myuser/Projects/test/auth_sample/ios/Runner.xcodeproj: warning: The linked framework 'Pods_Runner.framework' is missing one or more architectures required by this target: x86_64. (in target 'Runner' from project 'Runner')
  
  Could not build the application for the simulator.
  Error launching application on iPhone 12.
  </code></pre>
  <p>I have a mac mini 2020 with M1 architecture and I'm running the latest version of xcode 13.</p>
  <p>It seems that some libraries can't be compiled for the arm architecture, and since the iPhone simulator uses that architecture the build fails.</p>
  <p>I have also set up the <code>project.pbxproj</code> file for excluding the 9386 and arm64 architectures:</p>
  <pre><code>&quot;EXCLUDED_ARCHS[sdk=iphonesimulator*]&quot; = &quot;i386 arm64&quot;;
  </code></pre>
  <p>Do you have any idea on how to solve this? This issue started when I integrated the <code>google_sign_in</code> dependency.</p>
  <p><strong>UPDATE</strong>:</p>
  <p>Results for <code>flutter doctor -v</code> :</p>
  <pre><code> ~/Projects/test/auth_sample: flutter doctor                                                                                                                                                                              
      [✓] Flutter (Channel stable, 2.8.0, on macOS 12.1 21C52 darwin-arm, locale en-IT)
      • Flutter version 2.8.0 at /Users/myuser/Src/flutter
      • Upstream repository https://github.com/flutter/flutter.git
      • Framework revision cf44000065 (7 days ago), 2021-12-08 14:06:50 -0800
      • Engine revision 40a99c5951
      • Dart version 2.15.0
  
  [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
      • Android SDK at /Users/myuser/Library/Android/sdk
      • Platform android-31, build-tools 31.0.0
      • Java binary at: /Users/myuser/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7784292/Android Studio.app/Contents/jre/Contents/Home/bin/java
      • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
      • All Android licenses accepted.
  
  [✓] Xcode - develop for iOS and macOS (Xcode 13.2)
      • Xcode at /Applications/Xcode.app/Contents/Developer
      • CocoaPods version 1.11.2
  
  [✓] Chrome - develop for the web
      • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
  
  [✓] Android Studio (version 2020.3)
      • Android Studio at /Users/myuser/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7784292/Android Studio.app/Contents
      • Flutter plugin can be installed from:
         https://plugins.jetbrains.com/plugin/9212-flutter
      • Dart plugin can be installed from:
         https://plugins.jetbrains.com/plugin/6351-dart
      • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
  
  [✓] Android Studio (version 2020.3)
      • Android Studio at /Users/myuser/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7678000/Android Studio.app/Contents
      • Flutter plugin can be installed from:
         https://plugins.jetbrains.com/plugin/9212-flutter
      • Dart plugin can be installed from:
         https://plugins.jetbrains.com/plugin/6351-dart
      • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
  
  [☠] IntelliJ IDEA Ultimate Edition (the doctor check crashed)
      ✗ Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know about this issue at https://github.com/flutter/flutter/issues.
      ✗ FormatException: Unexpected extension byte (at offset 5)
      • #0      _Utf8Decoder.convertSingle (dart:convert-patch/convert_patch.dart:1789:7)
        #1      Utf8Decoder.convert (dart:convert/utf.dart:318:42)
        #2      InputStream.readString (package:archive/src/util/input_stream.dart:207:30)
        #3      new ZipDirectory.read (package:archive/src/zip/zip_directory.dart:40:30)
        #4      ZipDecoder.decodeBuffer (package:archive/src/zip_decoder.dart:19:30)
        #5      ZipDecoder.decodeBytes (package:archive/src/zip_decoder.dart:14:12)
        #6      IntelliJPlugins._findPluginXml (package:flutter_tools/src/intellij/intellij.dart:130:44)
        #7      IntelliJPlugins._readPackageVersion (package:flutter_tools/src/intellij/intellij.dart:141:40)
        #8      IntelliJPlugins.validatePackage (package:flutter_tools/src/intellij/intellij.dart:63:35)
        #9      IntelliJValidator.validate (package:flutter_tools/src/intellij/intellij_validator.dart:103:15)
        #10     asyncGuard.&lt;anonymous closure&gt; (package:flutter_tools/src/base/async_guard.dart:111:32)
        #11     asyncGuard.&lt;anonymous closure&gt; (package:flutter_tools/src/base/async_guard.dart:109:18)
        #12     _rootRun (dart:async/zone.dart:1428:13)
        #13     _CustomZone.run (dart:async/zone.dart:1328:19)
        #14     _runZoned (dart:async/zone.dart:1863:10)
        #15     runZonedGuarded (dart:async/zone.dart:1851:12)
        #16     runZoned (dart:async/zone.dart:1782:12)
        #17     asyncGuard (package:flutter_tools/src/base/async_guard.dart:109:3)
        #18     Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:197:9)
        #19     Doctor.diagnose (package:flutter_tools/src/doctor.dart:301:47)
        #20     DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:53:47)
        #21     FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1290:12)
        &lt;asynchronous suspension&gt;
        #22     FlutterCommand.run.&lt;anonymous closure&gt; (package:flutter_tools/src/runner/flutter_command.dart:1140:27)
        &lt;asynchronous suspension&gt;
        #23     AppContext.run.&lt;anonymous closure&gt; (package:flutter_tools/src/base/context.dart:150:19)
        &lt;asynchronous suspension&gt;
        #24     CommandRunner.runCommand (package:args/command_runner.dart:209:13)
        &lt;asynchronous suspension&gt;
        #25     FlutterCommandRunner.runCommand.&lt;anonymous closure&gt; (package:flutter_tools/src/runner/flutter_command_runner.dart:288:9)
        &lt;asynchronous suspension&gt;
        #26     AppContext.run.&lt;anonymous closure&gt; (package:flutter_tools/src/base/context.dart:150:19)
        &lt;asynchronous suspension&gt;
        #27     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:236:5)
        &lt;asynchronous suspension&gt;
        #28     run.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (package:flutter_tools/runner.dart:62:9)
        &lt;asynchronous suspension&gt;
        #29     AppContext.run.&lt;anonymous closure&gt; (package:flutter_tools/src/base/context.dart:150:19)
        &lt;asynchronous suspension&gt;
        #30     main (package:flutter_tools/executable.dart:94:3)
        &lt;asynchronous suspension&gt;
  
  
  [✓] IntelliJ IDEA Ultimate Edition (version 2021.3)
      • IntelliJ at /Users/myuser/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/213.5744.223/IntelliJ IDEA.app
      • Flutter plugin can be installed from:
         https://plugins.jetbrains.com/plugin/9212-flutter
      • Dart plugin can be installed from:
         https://plugins.jetbrains.com/plugin/6351-dart
  
  [✓] IntelliJ IDEA Ultimate Edition (version 2021.2.3)
      • IntelliJ at /Users/myuser/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/212.5457.46/IntelliJ IDEA.app
      • Flutter plugin version 61.2.4
      • Dart plugin version 212.5486
  
  [✓] VS Code (version 1.63.1)
      • VS Code at /Applications/Visual Studio Code.app/Contents
      • Flutter extension version 3.29.0
  
  [✓] Connected device (2 available)
      • iPhone 12 (mobile) • 9B4C7C94-F3AA-4370-820E-5CEAF6E0AA18 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
      • Chrome (web)       • chrome                               • web-javascript • Google Chrome 96.0.4664.110
  </code></pre>