0

Hello I buy an macbook m1 I have made a timemachine migration, I have upgrade android studio and xcode all is good. But when I try to run on my device I have first

error : pod out of date

so I try to

flutter clean remove pods folder and podfile.lock

pod repo update

but I have

Ignoring ffi-1.13.1 because its extensions are not built. Try: gem pristine ffi --version 1.13.1 /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.13.1/lib/ffi_c.bundle, 0x0009): tried: '/Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi_c.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) - /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/lib/ffi_c.bundle (LoadError)

SO I have try

 sudo gem uninstall cocoapods

but now I can't install cocoapods

i have brew install cocoapods zsh: command not found: brew

Nitneuq
  • 3,866
  • 13
  • 41
  • 64

1 Answers1

1

You can try running this command:

sudo arch -arm64e gem install ffi
Jonathan Perez
  • 254
  • 1
  • 7
  • No, because you are updating the architecture to arm64e, if this did not solve your problem you can run the command agian using -x86_64 replacing arm64e – Jonathan Perez Sep 09 '22 at 20:43
  • OK, it's done. but I have always CocoaPods not installed. Skipping pod install. CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions. Exception: CocoaPods not installed or not in valid state. – Nitneuq Sep 09 '22 at 20:51
  • I need to use sudo arch -x86_64 gem install ffi ? – Nitneuq Sep 09 '22 at 20:52
  • I run sudo gem install cocoapods and pod repo update it's loading. – Nitneuq Sep 09 '22 at 20:58
  • [NOTE] You may have encountered a bug in the Ruby interpreter or extension libraries. Bug reports are welcome. For details: https://www.ruby-lang.org/bugreport.html [IMPORTANT] Don't forget to include the Crash Report log file under DiagnosticReports directory in bug reports. – Nitneuq Sep 09 '22 at 21:01
  • What do you get about this bug? – Jonathan Perez Sep 09 '22 at 21:03
  • I don't know, after run pod repo update it stop at 559 /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi.rb – Nitneuq Sep 09 '22 at 21:04
  • 1
    see this: https://stackoverflow.com/questions/66644365/cocoapods-on-m1-apple-silicon-fails-with-ffi-wrong-architecture – Jonathan Perez Sep 09 '22 at 21:05
  • thank you, I try brew uninstall ruby --force but zsh: command not found: brew – Nitneuq Sep 09 '22 at 21:07
  • 1
    Ok.. first you need install HomeBrew using this command : /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" – Jonathan Perez Sep 09 '22 at 21:11
  • now I have dquote> – Nitneuq Sep 09 '22 at 21:16
  • I can't run anything – Nitneuq Sep 09 '22 at 21:17
  • what do you get? – Jonathan Perez Sep 09 '22 at 21:18
  • nothing just my terminal now start with dquote> – Nitneuq Sep 09 '22 at 21:19
  • but I can't run flutter doctor or other command with this dquote> – Nitneuq Sep 09 '22 at 21:19
  • OK, I quit android studio and it's normal now – Nitneuq Sep 09 '22 at 21:20
  • I don't know if /bin/bash -c "$(curl -fsSL raw.githubusercontent.com/Homebrew/install/HEAD/install.sh) have done somthing.. – Nitneuq Sep 09 '22 at 21:20
  • basically that command installs homebrew – Jonathan Perez Sep 09 '22 at 21:22
  • OK, how can I verify that homebrew was well install ? or what can I do after ? – Nitneuq Sep 09 '22 at 21:24
  • now when I run pod repo update I have/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin21/rbconfig.rb:230: warning: Insecure world writable dir /Users/XXXXX/Developer/flutter/bin in PATH, mode 040777 Updating spec repo `master` Updating spec repo `trunk`. [!] CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/deprecated_podspecs.txt Response: URL using bad/illegal format or missing URL – Nitneuq Sep 09 '22 at 21:30
  • I run pod repo remove trunk I can now run pod repo update and now I pod is installing – Nitneuq Sep 09 '22 at 21:36
  • 1
    finally I have some stuck on running, so I create a new flutter projet, to test basic example, it's ok, so I migrate all lib,asset etc and it's ok. By the way, thank you, for the support, this help me to not be crazy ^^ – Nitneuq Sep 10 '22 at 09:54