Flutter error: CocoaPods’s specs repository is too out-of-date

Last updated on March 28, 2021 Pennywise Loading... Post a comment

This article is about an error you may encounter when running a Flutter application on iOS.


The error often occurs when you use one or many packages related to Firebase like cloud_firestore, firebase_analytics, firebase_auth, firebase_messaging, firebasee_storage, etc.

The error message is so long but the last lines of it are most informative:

Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.
To update the CocoaPods specs, run:
  pod repo update

Error running pod install
Error launching application on iPhone 12 Pro Max.

The error happend because your cocopods repo is out of date.

If you run the update command as instructed by the error message, it will NOT work as expected:

pod repo update

Don’t be panic. The following solution will fix the bug just fine.


The steps:

1. Delete the Podfile.lock file in <your-project>/ios directory:

Note: “Podfile.lock” is used to make sure that every member of the team has the same versions of pods installed on the project. I will be auto-generated with the “flutter run” command.

2. Also in the ios folder, run the following command:

pod install --repo-update

This command will update the CocoaPods specs.

3. Go back to the root directory of your project then execute this:

flutter clean

This command will clear the build cache which is generated on application run time when a temporary file automatically generated in the dart-tools folder, android folder, and iOS folder.

4. Finally, perform the following:

flutter run

Final Words

We’ve solved a common error when developing an iOS application with Flutter and Firebase. You can explore more about these things by taking a look at the following articles:

You can also check out our Flutter topic page or Dart topic page for the latest tutorials and examples.

Related Articles

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x