38

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). enter image description here

How do I go about solving this issue?

Samarth Shah
  • 501
  • 1
  • 6
  • 7

2 Answers2

86

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.

boonyongyang
  • 1,017
  • 7
  • 6
30

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
Ali80
  • 2,700
  • 1
  • 25
  • 25