Error Regarding undefined method `map' for nil:NilClass for Flutter App / CocoaPod Error
Solution 1
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.
Solution 2
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
Samarth Shah
Samarth Shah= I do android programming or otherwise known as XML, and am learning the Java in it know.
Updated on December 29, 2022Comments
-
Samarth Shah over 1 year
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?
-
Haseeb Burki almost 3 yearsIs there any diff b/w running this command and changing the terminal option to "open with rosetta" fix?
-
Dohan Smit over 2 yearsThis helped a lot..Thank you
-
Sharjeel Ali over 2 yearsThis is happening when I started flutter development in MacBook M1. On my old MacBook, it was normal and working fine. Does anyone know the reason?
-
Royalty over 2 yearsThanks helped me too :)
-
famfamfam about 2 yearshi, please help my problem : stackoverflow.com/questions/71866620/…
-
Lalit Fauzdar almost 2 yearsI've installed this multiple times, not working.
-
efesahin almost 2 yearsworks for apple MacBook Pro m1 <3
-
Daniel almost 2 yearsworks for Apple Macbook Air M1 aswell. I had to do that everytime I installed a new Firebase plugin.
-
Felix Mittermeier almost 2 yearsGood answer but it might be good to mention that you have to run all suggested fixes from flutter also with this new prefix. For example: "pod update Firebase/Messaging" -> "arch -x86_64 pod update Firebase/Messaging"