3

I get the below error/log when i implement the google_sign_in package to my flutter application. I'm using m1 chip. all the packages, flutter framework and xcode at their last versions.

Flutter project dependencies:

  • http: ^0.13.4
  • firebase_auth: ^3.3.6
  • google_sign_in: ^5.2.3

At the first i got this:



    Error output from CocoaPods:
    ↳
        [!] Automatically assigning platform `iOS` with version `9.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.


Then I've uncomment this platform :ios, '9.0' at ios/Podfile

But different error shows up like this:



    Launching lib/main.dart on iPhone 13 in debug mode...
    lib/main.dart:1
    CocoaPods' output:
    ↳
          Preparing
        Analyzing dependencies
        Inspecting targets to integrate
          Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
        Fetching external sources
        -> Fetching podspec for `Flutter` from `Flutter`
        -> Fetching podspec for `firebase_auth` from `.symlinks/plugins/firebase_auth/ios`
        firebase_auth: Using Firebase SDK version '8.11.0' defined in 'firebase_core'
        -> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
        firebase_core: Using Firebase SDK version '8.11.0' defined in 'firebase_core'
        -> Fetching podspec for `google_sign_in` from `.symlinks/plugins/google_sign_in/ios`
        Resolving dependencies of `Podfile`
    Error output from CocoaPods:
    ↳
        /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi_c.bundle, 0x0009): tried: '/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi_c.bundle' **(mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))**, '/usr/lib/ffi_c.bundle' (no such file) - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi_c.bundle (LoadError)
            from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
            from /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi.rb:5:in `rescue in '
            from /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi.rb:2:in `'
    2
            from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
            from /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon.rb:3:in `'
    2
            from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
            from /Library/Ruby/Gems/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `'
    2
            from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    ...


I think because of the m1 chip that i using, according to this error message (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')) Does anyone have an idea about this issue?

Also, the below subjects' answers didn't work for me.

Flutter Error running pod install After Upgrading Flutter version

Flutter pod install issue and ios app not running

https://github.com/CocoaPods/CocoaPods/issues/10127#issuecomment-705741320

Erdem Siyam
  • 103
  • 1
  • 4
  • 9

4 Answers4

8

Use these commands in your project files to manually install pod files:

  1. cd ios

  2. arch -x86_64 pod install

  3. cd ..

  4. flutter run

CidQu
  • 412
  • 6
  • 13
  • 1
    Thank you very much for your valuable reply. Based on the answer I research and i found another code also "sudo arch - x86_64 gem install ffi" i executed this before yours, i found it from there "https://stackoverflow.com/questions/69055694/cocoapod-error-tried-to-install-all-the-possible-way-on-m1" , and its worked. Thank you again for you kind help. – Erdem Siyam Feb 06 '22 at 10:37
2

run this code on your terminal

sudo arch -x86_64 gem install ffi

Next, go to the ios folder in your project, and open Podfile.

Change the 9.0 to 10.0, as the below

platform :ios, '10.0'
Fakhriddin Abdullaev
  • 4,169
  • 2
  • 35
  • 37
1

I had the same problem

Here is my solution.

  1. open 'ISO foler' with Xcode
  2. click Runner folder at top, and copy bundle identifier
  3. go to firebase website and start IOS connection
  4. paste the copied identifier and click next
  5. download the plist file and move to runner folder
  6. go to ios folder

arch -x86_64 pod install cd .. flutter run

The point is that you should manually connect firebase to flutter. I used the flutter connection thing that firebase recently added. But it has some glitch I guess.

Minki Jung
  • 75
  • 1
  • 6
-2

install boringssl-grpc which can solve the probe