I'm having an error regarding my Flutter application. When I run the "flutter run" script in terminal, I'm getting the following error from Cocoapods: "Error output from CocoaPods: Searching for inspections failed: undefined method `map' for nil:NilClass" (as seen also by the attached picture).
How do I go about solving this issue?
Are you using Apple M1? I had this issue as well and after some research I find that it might be something to do with Rosetta. You can refer to Running CocoaPods on Apple Silicon (M1).
I managed to solve this issue on my MacBook Air M1 by typing this in the terminal:
sudo arch -x86_64 gem install ffi
from here https://stackoverflow.com/a/65334677/13814270.
I was trying to run pod install command in ios folder.
@boonyongyang solution is necessary but it seemed that I had 2 ffi
's installed, so I had to also run it with arch -x86_64
command
sudo arch -x86_64 gem install ffi
# go to ios folder then run
arch -x86_64 pod install
There is a new recommended method by flutter team as also mentioned by @Chandrashekar-Ollala
sudo gem uninstall ffi && sudo gem install ffi -- --enable-libffi-alloc
I struggled for many hours to figure this out, none of the solutions from Stack Overflow worked. Finally, I found this note in official Flutter documentation:
This problem arises on computers running on M1 chip. Just run the following code snippet in your terminal and everything works fine.
sudo gem uninstall ffi && sudo gem install ffi -- --enable-libffi-alloc
On my MacBook M1 that issue came up when I accidentally added an blank line to the pubspec.yaml
file. Deleting the line solved the issue (it looks like you can't have two empty lines one after another).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With