Getting "CocoaPods could not find compatible versions for pod "Firebase/Database" " Error on flutter

Viewed 2404

i have followed an exact guide on how to setup a geofire on to my project. i have success on my android project.. but i cant get it to run for the ios.. and it has the following error as i try to run it.

[!] CocoaPods could not find compatible versions for pod "Firebase/Database":
  In Podfile:
    firebase_database (from `.symlinks/plugins/firebase_database/ios`) was resolved to 6.1.2, which depends on
      Firebase/Database (= 7.11.0)

    flutter_geofire (from `.symlinks/plugins/flutter_geofire/ios`) was resolved to 0.0.1, which depends on
      GeoFire (~> 4.0) was resolved to 4.1.0, which depends on
        Firebase/Database (~> 6.0)

I've tried to run pod update and this is the result

Macbook-MBP:ios Macbook$ pod update
Update all pods
Updating local specs repositories
Analyzing dependencies
firebase_auth: Using Firebase SDK version '7.11.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '7.11.0' defined in 'firebase_core'
firebase_database: Using Firebase SDK version '7.11.0' defined in 'firebase_core'
[!] CocoaPods could not find compatible versions for pod "Firebase/Database":
  In Podfile:
    firebase_database (from `.symlinks/plugins/firebase_database/ios`) was resolved to                             
    6.1.2, which depends on Firebase/Database (= 7.11.0)

    flutter_geofire (from `.symlinks/plugins/flutter_geofire/ios`) was resolved to 0.0.1,
     which depends on
  GeoFire (~> 4.0) was resolved to 4.1.0, which depends on
    Firebase/Database (~> 6.0)

and this is what i've imported to my pubspec.yaml file..

  firebase_database: ^6.1.2
  flutter_geofire: ^2.0.0

i dont understand what im doing wrong, any help would be appreciated.. thanks

4 Answers

for anyone that is facing this issue,

  1. run flutter clean in the terminal
  2. add this line at the bottom of the podfile
    pod 'GeoFire', :git => 'https://github.com/mrdishant/geofire-objc', :tag => '4.3.0'
  3. dont forget to add use_frameworks! on top of the podfile
  4. delete Pod folder from iOS.
  5. change platform :ios, '10.0' to platform :ios, '11.0' on the podfile
  6. run pod repo update then pod update
  7. then run flutter run in the terminal

thats how i got it working for me

Updating the platform configured in the Podfile to platform :ios, '10.0' didn't work for me. I've had to update the iOS Deployment Target to 10.0 - located on Runner > Info > Deployment Target

Xcode iOS Deployment Target

After that, deleting the Podfile.lock with rm -rf Podfile.lock then running pod update and pod install solved the issue for me.

Same issue here. I've been trying to fix for weeks. Can't find anything online either. If you figure it out please post! Sorry, I do not have enough 'reputation points' to comment yet :(

Faced the same challenge but all of the above solutions didn't work for me. What worked for me:

  1. Following the link shown in the error (I've highlighted): enter image description here

  2. In you IDE, go to Project File -> ios -> .symlinks -> plugins -> firebase_database -> ios enter image description here

  3. Open the .podspec file of the dependency. enter image description here

  4. Look for: s.ios.deployment_target = '12.0'

  5. I think the "s.ios.deployment_target" should be less than or equal to the "platform :ios, 'XX.0'" in the Podfile. enter image description here

  6. After changing s.ios.deployment_target value to less than in the platform :ios, in the podfile, try removing Podfile.lock, pod install --repo-update etc.

  7. Do the same for other podfiles throwing the error, in your case: flutter_geofire, firebase_database etc.

  8. You can check this solution too. [https://stackoverflow.com/questions/65881232/specs-satisfying-the-firebase-admob-but-they-required-a-higher-minimum-deploy]

Related