flutter: running pod install takes forever while building in debug mode

Viewed 7159

Using iphone 11 iOS-14 device and simulator, I have deleted THE podfile and podlock of my flutter app and trying to rebuild the app in debug MODE, i am using the latest firebase dependencies including cloud_firestore: ^0.14.1 dependency then it gets stuck at pod install and is taking forever to finish, been more than half an hour.

I wonder if i should wait longer or is there something wrong with firebase dependencies?

3 Answers

Pod install is not stuck, when you delete Podfile.lock, pod install will redownload all pod dependencies, will take a long time, after finish, it will create a new Podfile.lock

I have a project that have 20+ dependencies for flutter, firebase dependencies are the most complex ones

If you have spent 20-30 minutes of your time holding onto pod install and yet it seems to stuck forever (Possibly installed firebase dependencies then running same project on different machine). Then there are other workaround to it.

Clean cache and pub get your dependencies

flutter clean
flutter pub get

Navigate to your ios folder from the terminal

cd ios

Remove Trunk

pod repo remove trunk

If your current installation is in Intel Chipped Mac run the code below

pod install --repo-update

If your installation is in M1 chip device install ffi first

sudo arch -x86_64 gem install ffi

Then update POD

arch -x86_64 pod install --repo-update

Now clean and fetch dependencies

flutter clean
flutter pub get

If you encountered an error similar to like below

[!] CocoaPods could not find compatible versions for pod "cloud_firestore":
  In Podfile:
    cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`)

Specs satisfying the `cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`)` dependency were found, but they required a higher minimum deployment target.

[!] Automatically assigning platform `iOS` with version `9.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

Then go to podfile, uncomment platmform:ios line and update it

platform :ios, '12.0'

Now re-run the command

arch -x86_64 pod install --repo-update

Don't Forget to clean pub caches with flutter clean

Related