Flutter: CocoaPods's specs repository is too out-of-date to satisfy dependencies
Asked Answered
L

13

269

Current, I was trying to add firebase_core: ^0.5.0+1 and firebase_crashlytics: ^0.2.1+1 packages in my flutter project with the latest versions, It works without any trouble in Android but in iOS, it is not working and giving error. So now how to run my project with the latest package in the iOS Flutter project?

I also tried to pod repo update but it is still not working

I am getting this error on flutter run

CocoaPods' output:
↳
      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

    Finding Podfile changes
      A firebase_crashlytics
      - Flutter
      - contact_picker
      - device_info
      - file_picker
      - firebase_auth
      - firebase_core
      - firebase_messaging
      - flutter_keyboard_visibility
      - flutter_local_notifications
      - flutter_webview_plugin
      - image_picker
      - path_provider
      - phone_number
      - share
      - shared_preferences
      - sqflite
      - url_launcher

    Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `contact_picker` from `.symlinks/plugins/contact_picker/ios`
    -> Fetching podspec for `device_info` from `.symlinks/plugins/device_info/ios`
    -> Fetching podspec for `file_picker` from `.symlinks/plugins/file_picker/ios`
    -> Fetching podspec for `firebase_auth` from `.symlinks/plugins/firebase_auth/ios`
    firebase_auth: Using Firebase SDK version '6.26.0' defined in 'firebase_core'
    -> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
    firebase_core: Using Firebase SDK version '6.26.0' defined in 'firebase_core'
    -> Fetching podspec for `firebase_crashlytics` from `.symlinks/plugins/firebase_crashlytics/ios`
    firebase_crashlytics: Using Firebase SDK version '6.26.0' defined in 'firebase_core'
    -> Fetching podspec for `firebase_messaging` from `.symlinks/plugins/firebase_messaging/ios`
    firebase_messaging: Using Firebase SDK version '6.26.0' defined in 'firebase_core'
    -> Fetching podspec for `flutter_keyboard_visibility` from `.symlinks/plugins/flutter_keyboard_visibility/ios`
    -> Fetching podspec for `flutter_local_notifications` from `.symlinks/plugins/flutter_local_notifications/ios`
    -> Fetching podspec for `flutter_webview_plugin` from `.symlinks/plugins/flutter_webview_plugin/ios`
    -> Fetching podspec for `image_picker` from `.symlinks/plugins/image_picker/ios`
    -> Fetching podspec for `path_provider` from `.symlinks/plugins/path_provider/ios`
    -> Fetching podspec for `phone_number` from `.symlinks/plugins/phone_number/ios`
    -> Fetching podspec for `share` from `.symlinks/plugins/share/ios`
    -> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
    -> Fetching podspec for `sqflite` from `.symlinks/plugins/sqflite/ios`
    -> Fetching podspec for `url_launcher` from `.symlinks/plugins/url_launcher/ios`

    Resolving dependencies of `Podfile`
      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_1_6_1.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/1/6/1/DKImagePickerController/4.3.2/DKImagePickerController.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/1/6/1/DKImagePickerController/4.3.2/DKImagePickerController.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_0_3_5.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/6.34.0/Firebase.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/6.26.0/Firebase.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/6.26.0/Firebase.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/6.26.0/Firebase.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_2_4_b.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/2/4/b/PhoneNumberKit/3.3.1/PhoneNumberKit.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/2/4/b/PhoneNumberKit/3.2.0/PhoneNumberKit.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/6.26.0/Firebase.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_f_4_e.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/f/4/e/FMDB/2.7.5/FMDB.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/6.26.0/Firebase.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_2_d_6.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/2/d/6/FirebaseMessaging/4.7.1/FirebaseMessaging.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/2/d/6/FirebaseMessaging/4.4.1/FirebaseMessaging.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_6_f_9.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/6/f/9/FirebaseAnalyticsInterop/1.5.0/FirebaseAnalyticsInterop.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_8_b_d.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/8/b/d/FirebaseCore/6.10.4/FirebaseCore.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_3_6_0.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/3/6/0/FirebaseInstanceID/4.8.0/FirebaseInstanceID.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_0_8_4.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/0/8/4/GoogleUtilities/6.7.2/GoogleUtilities.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/0/8/4/GoogleUtilities/6.7.2/GoogleUtilities.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/0/8/4/GoogleUtilities/6.7.2/GoogleUtilities.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/0/8/4/GoogleUtilities/6.7.2/GoogleUtilities.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/0/8/4/GoogleUtilities/6.7.2/GoogleUtilities.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_e_c_d.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/e/c/d/Protobuf/4.0.0-rc1/Protobuf.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/e/c/d/Protobuf/3.13.0/Protobuf.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_6_3_6.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/6/3/6/FirebaseAuth/6.9.2/FirebaseAuth.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/6/3/6/FirebaseAuth/6.5.3/FirebaseAuth.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_4_2_7.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/4/2/7/FirebaseAuthInterop/1.1.0/FirebaseAuthInterop.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_c_e_3.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/c/e/3/GTMSessionFetcher/1.4.0/GTMSessionFetcher.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/c/e/3/GTMSessionFetcher/1.4.0/GTMSessionFetcher.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_e_7_d.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/e/7/d/FirebaseCrashlytics/4.6.2/FirebaseCrashlytics.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/e/7/d/FirebaseCrashlytics/4.1.1/FirebaseCrashlytics.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_2_f_7.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/2/f/7/FirebaseInstallations/1.7.0/FirebaseInstallations.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_0_b_5.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/0/b/5/PromisesObjC/1.2.11/PromisesObjC.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_0_6_a.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/0/6/a/GoogleDataTransport/7.5.1/GoogleDataTransport.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_b_c_f.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/b/c/f/GoogleDataTransportCCTSupport/3.2.0/GoogleDataTransportCCTSupport.podspec.json exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: all_pods_versions_6_1_e.txt exists! Returning local because checking is only perfomed in repo update
      CDN: trunk Relative path: Specs/6/1/e/nanopb/2.30906.0/nanopb.podspec.json exists! Returning local because checking is only perfomed in repo update
    [!] CocoaPods could not find compatible versions for pod "GoogleDataTransport":
      In snapshot (Podfile.lock):
        GoogleDataTransport (= 7.4.0, ~> 7.4)

      In Podfile:
        firebase_crashlytics (from `.symlinks/plugins/firebase_crashlytics/ios`) was resolved to 0.2.1-1, which depends on
          Firebase/Crashlytics (~> 6.26.0) was resolved to 6.26.0, which depends on
            FirebaseCrashlytics (~> 4.1.1) was resolved to 4.1.1, which depends on
              GoogleDataTransport (~> 6.1)


    You have either:
     * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
     * changed the constraints of dependency `GoogleDataTransport` inside your development pod `firebase_crashlytics`.
       You should run `pod update GoogleDataTransport` to apply changes you've made.

    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `tap'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:257:in `process_topmost_state'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/resolver.rb:94:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/installer/analyzer.rb:1074:in `block in resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/installer.rb:414:in `analyze'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/installer.rb:238:in `resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/installer.rb:160:in `install!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/command/install.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.rc.1/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.rc.1/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:23:in `load'
    /usr/local/bin/pod:23:in `<main>'

Error output from CocoaPods:
↳

    [!] Automatically assigning platform `iOS` with version `10.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`.

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 11 Pro.
Logbook answered 20/10, 2020 at 11:5 Comment(3)
Run pod repo updateAntipyrine
try.. -- flutter clean, pod repo update, deleted /ios/Pods/ and /ios/Podfile.lockPetuu
I tried flutter clean and that worked for me.Shulman
B
321

This worked for me:

  1. flutter clean
  2. Delete /ios/Pods
  3. Delete /ios/Podfile.lock
  4. flutter pub get
  5. from inside ios folder: pod install
  6. flutter run
Bremsstrahlung answered 1/2, 2021 at 22:42 Comment(4)
Before these steps, go to XCode Target - Runner - Deployment Info and change iOS target version to iOS 10.0Bremsstrahlung
What if I have a package that only runs above iOS 12?Cath
The above plus flutter upgrade worked for meGarica
It seems the above including these comments must be repeated every so often. This is the second time I have followed directions like these. Thank you : )Dampen
C
82

How I resolved this...

Remove pod completely

  1. Go to /ios folder inside your Project.

  2. Delete Podfile.lock (YourPoject/ios/Podfile.lock)

  3. run cmd pod repo remove trunk

Now you have removed the pod completely.

Update pod repo

Now run one of the following according to the chip of your Mac (thanks to @Kamal Panara for identifying this):

For Intel chip users

Run this in the ios directory of your Flutter app:

pod install --repo-update
For M1 chip Users

Install ffi first (if not already installed) in regular terminal using command:

sudo arch -x86_64 gem install ffi 

then run:

arch -x86_64 pod install --repo-update

Note if you are getting an error of

[!] 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 the podfile at line just uncomment the line and make it similar like below.

platform :ios, '12.0'

Now re-run this cmd.

arch -x86_64 pod install --repo-update

Now this time it will work fine.

flutter clean

now run

flutter clean

then

flutter run

Enjoy.

Coverage answered 13/3, 2022 at 15:50 Comment(5)
worked liked a charm.. thanks. My MacBook is m1 proWharfage
Just "arch -x86_64 pod install --repo-update" fixed my all problems thanks!Fenella
The perfect solution for M1 chips. Many thanksSpurling
This worked on M1 Mac - 2023 AprilCampanology
If you're getting errors like permission denied, use arch -x86_64 /bin/bash -l and then run gem install ffi and pod install --repo-update --allow-rootCecil
E
35

This worked for me, NO need to run flutter clean

  1. goto ios folder inside your project
  2. remove Podfile.lock
  3. run flutter pub get if your Podfile is out of date or non-existent.
  4. run pod install under ios folder
Egypt answered 16/7, 2021 at 8:33 Comment(4)
I think with flutter 1.20 and windows we dont have the "pod" executable/cli inside IOs folder, tried "flutter pod install", "pod install", nothing works. I tried just flutter pub get it didnt work tooCrimea
@Crimea cocopods is ios/mac specific.Egypt
+ If your build gets stuck, run flutter clean && flutter runChurchwell
The second point worked for me! Thanks manGuard
N
16

For me, simply removing podfile.lock and re-running with flutter run did the trick.

Nievelt answered 23/3, 2022 at 13:57 Comment(0)
T
8

I was having a similar issue with the same error message when trying to add new features to my Flutter app. I was using Flutter 3.0.5 and didn't want to update it, but I kept encountering this error.

After a week of trying to fix the issue with little tweaks here and there, I finally found a solution that worked for me. I ran the following command in my Flutter project :

flutter upgrade && flutter clean && rm -rf ios/Pods && rm ios/Podfile.lock && flutter packages get && flutter pub get && cd ios && pod install && cd .. && flutter run

This command upgrades Flutter, cleans the project, removes the Pods directory and Podfile.lock file, and reinstalls the packages and dependencies. It also runs the "pod install" command in the ios directory to install the iOS dependencies and then runs the flutter run command to start the app.

This worked for me and I was able to add new features without encountering the same error again. I hope it helps others who are running into this issue.

Those answered 28/1, 2023 at 11:35 Comment(0)
D
3

If your Run folder dont have /ios/Podfile.lock you just need open your IOS foler in terminal and run : $ pod repo update

Dedie answered 20/2, 2022 at 19:36 Comment(0)
L
3

Try the following steps. It worked for me:

  • flutter clean

  • delete /ios/Pods

  • delete /ios/Podfile.lock

In the ios folder, run the following command:

pod install --repo-update

Finally, perform the following:

flutter run
Lilongwe answered 9/5, 2022 at 8:35 Comment(1)
+1 This worked for me! The important thing is, after deleting the Pods folder and Podfile.lock file, pod install --repo-update requires flutter pub get first.Euchromatin
R
3

in my case it was fixed by :

first of all: deleting podfile.lock

then running: flutter clean

after that:

flutter pub get

finally : go to iOS folder cd ios pod install

and the project will run now

if you are opening project for the first time then: first of all: delete podfile.lock

1=> delete pub spec.lock because it sometimes project cached old flutter versions

2=> flutter clean

3=> flutter pub get

4=> go to iOS folder cd ios pod install

5=> if you got any error related to this:

Error: Field 'wLanguage' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`

so pls run : flutter pub upgrade to update packages also

and finally it will work

Realgar answered 19/5, 2023 at 14:14 Comment(0)
P
2

Delete these 2 files

1. ios/pods
2. ios/podfile.lock
3. flutter pub get

then navigate to the ios folder

4. cd ios
5. pod install

wait for the pods to install and run your project

Prescription answered 10/11, 2023 at 9:40 Comment(0)
A
1

This issue happens when there is a mismatch in the pod files.

The solution is pointed out by Flutter itself in the debug console. enter image description here

The common mistake that people make is run the command directly in the project. You have to run it in the ios folder of the project.

  1. Set the path of your terminal to the ios folder. Just add /ios after your project path. Eg - cd /Users/workfolder/flutter_project/ios
  2. Run the command pod repo update or just pod update.

It will download all the dependencies and fix all the issue with the pod. Then you can run your app normally.

Axel answered 7/10, 2022 at 12:48 Comment(0)
C
0

This worked for me,

  1. Delete the Podfile.lock file
  2. Run -> flutter pub get in terminal
  3. Run -> arch -x86_64 pod install in terminal After that, you are ready to go.
Clef answered 11/10, 2022 at 17:54 Comment(0)
E
-3

Try the following steps :

pod ios

pod cache clean --all

Pod clean

pod deintegrate

sudo gem install cocoapods-deintegrate cocoapods-clean

sudo arch -x86_64 gem install ffi

arch -x86_64 pod repo update

arch -x86_64 pod install
Exeunt answered 25/2, 2023 at 15:25 Comment(1)
leave proper comments what all this command do and whyFont
O
-4

In my case:

  1. Open android studio for mac.
  2. Go to ios folder.
  3. Delete podfile and podfile.lock
  4. Run flutter pub get.
  5. Go to ios folder by terminal and run "pod install".

enter image description here

Oriole answered 25/10, 2022 at 16:49 Comment(2)
Don't delete PodfileMohandis
Dont delete Podfile, you will lost configsUniversalize

© 2022 - 2025 — McMap. All rights reserved.