Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve "error running pod install" in flutter on mac?

I have an error when I tried to launch my project on my iPhone, the basic Flutter example is working on my iPhone but when I use my project I have this error.

enter image description here

like image 447
Nitneuq Avatar asked Jan 10 '19 18:01

Nitneuq


4 Answers

This happens when we change any plugins versions or flutter pub package.

I was getting a similar error, so I used many different things but still nothing happened but finally I got an exact solution For the solution follow the below steps

  1. Delete the podfile.lock file from the ios folder.

  2. Open the terminal, go to the ios folder directory and run pod install. It could take some time to install.

    If pod install gives any error then try this

    pod install --repo-update  
  3. After everything is done run your project again

    flutter run 

Ref:- Running pod install

like image 113
Paresh Mangukiya Avatar answered Sep 23 '22 23:09

Paresh Mangukiya


You can fix it with

sudo arch -x86_64 gem install ffi
like image 63
Abraams gtr Avatar answered Nov 07 '22 10:11

Abraams gtr


In Flutter project, I Also faced with this issue. Fixed by updating flutter and cocoa pods to the latest version.

Solution:-

flutter clean
rm -Rf ios/Pods
rm -Rf ios/.symlinks
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec
flutter pub get
cd ios
pod install 
arch -x86_64 pod install  //(On an M1 mac use => arch -x86_64 pod install)
cd ..
flutter build ios
flutter run
like image 62
Vidura Silva Avatar answered Nov 07 '22 09:11

Vidura Silva


I got this error when I was using Firebase in flutter, the solution for me was to set the Podfile deployment target to a iOS version higher than 9.

Example: Changed this

#platform :ios, '9.0'

to

 platform :ios, '13.0'

And as @Mana commented, remember the higher the version you set, your app will not be supported for users with lower IOS versions

like image 25
broderbluff Avatar answered Nov 07 '22 09:11

broderbluff