111

I am having some issues in the pod, see below

Launching lib/main.dart on iPhone X in debug mode... Running pod install... CocoaPods' output: ↳ Preparing

Analyzing dependencies

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

Fetching external sources
-> Fetching podspec for `Flutter` from `.symlinks/flutter/ios`
-> Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
-> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
-> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
-> Fetching podspec for `url_launcher` from `.symlinks/plugins/url_launcher/ios`

Resolving dependencies of `Podfile`
[!] CocoaPods could not find compatible versions for pod "Firebase/Core":
  In Podfile:
    cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on
      Firebase/Core

Specs satisfying the `Firebase/Core` dependency were found, but they required a higher minimum deployment target.
CocoaPods could not find compatible versions for pod "GoogleUtilities/MethodSwizzler":
  In Podfile:
    cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on
      Firebase/Core was resolved to 5.8.0, which depends on
        FirebaseAnalytics (= 5.1.2) was resolved to 5.1.2, which depends on
          GoogleUtilities/MethodSwizzler (~> 5.2.0)

Specs satisfying the `GoogleUtilities/MethodSwizzler (~> 5.2.0)` dependency were found, but they required a higher minimum deployment target.
CocoaPods could not find compatible versions for pod "gRPC-Core":
  In Podfile:
    cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on
      Firebase/Firestore was resolved to 5.8.0, which depends on
        FirebaseFirestore (= 0.13.3) was resolved to 0.13.3, which depends on
          gRPC-C++ (~> 0.0.3) was resolved to 0.0.3, which depends on
            gRPC-C++/Implementation (= 0.0.3) was resolved to 0.0.3, which depends on
              gRPC-Core (= 1.14.0)

    cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on
      Firebase/Firestore was resolved to 5.8.0, which depends on
        FirebaseFirestore (= 0.13.3) was resolved to 0.13.3, which depends on
          gRPC-ProtoRPC (~> 1.0) was resolved to 1.14.1, which depends on
            gRPC-ProtoRPC/Main (= 1.14.1) was resolved to 1.14.1, which depends on
              gRPC (= 1.14.1) was resolved to 1.14.1, which depends on
                gRPC/Main (= 1.14.1) was resolved to 1.14.1, which depends on
                  gRPC-Core (= 1.14.1)

/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:308:in `tap'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:684:in `attempt_to_activate'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:254:in `process_topmost_state'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:182:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.5/lib/molinillo/resolver.rb:43:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/resolver.rb:123:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:781:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:779:in `resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:88:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:243:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:154:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:153:in `resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:116:in `install!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/command/install.rb:41:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'

Error output from CocoaPods: ↳ [33mWARNING: CocoaPods requires your terminal to be using UTF-8 encoding. Consider adding the following to ~/.profile:

    export LANG=en_US.UTF-8
    [0m

[!] Automatically assigning platform `ios` with version `8.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 running pod install Error launching application on iPhone X.

Jashan PJ
  • 4,177
  • 4
  • 27
  • 41
  • Same problem here, no solution.... – Bruno Sep 19 '18 at 14:51
  • I didn’t find any fix for the above said issue, but downgrading the flutter to old which dart 1 and cloud_firestore 7.4 will avoid these problems. But pop ups some other.. like this one ‘ atal error: 'GoogleUtilities/GULAppEnvironmentUtil.h' file not found #import ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ‘ – Jashan PJ Sep 20 '18 at 14:57

25 Answers25

226

My setup: VS Code, Flutter

If you don't have Podfile.lock file and pod update doesn't help, try this:

  1. Go to ios/Pods/Local Podspecs directory in your project
  2. Check every json file to find highest required ios version. Mine was "ios": "10.0" in some of them
  3. Go back to ios/ directory
  4. Open Podfile file
  5. Uncomment # platform :ios, '9.0' and replace 9.0 with version from 2. step, for example 10.0.
    • # platform :ios, '9.0' > platform :ios, '10.0'
  6. Run pod install and the error should be gone
Luca_54
  • 529
  • 4
  • 16
Preckrasno
  • 2,435
  • 1
  • 10
  • 20
  • 4
    Yeah I did this too, worked. I think the flutterfire team needs to fix their dang dependencies – Shazamo Morebucks Jan 20 '21 at 13:09
  • agree @ShazamoMorebucks this is very cumbersome, I believe tech lead's comments on YouTube regarding Flutter have a lot of merit. I don't see Flutter as a long term solution as its fundamentally broken with so many issues that are never fixed. – Modesto Cabrera Feb 21 '21 at 09:35
  • 1
    It's important not forgetting to **uncomment** the `# platform :ios, '9.0'` line as it is commented by default and one may not see that immediately. – Renaud Tarnec Apr 09 '21 at 16:49
  • This solution painkiller for me. Thank you. – Utku Apr 17 '21 at 14:25
  • Legend. Thanks a lot – Neo May 17 '21 at 14:23
  • This works for me, but I just need to uncomment the platform on podfile one, and increase the minimum platform to 11.0 no need to go into each local podspecs. – Chen Li Yong May 25 '21 at 06:52
  • Why isn't this marked as the answer already? – Kenneth Murerwa Jun 02 '21 at 06:58
  • To get the version numbers out of all the json files, run this command: find ios/Pods/Local\ Podspecs/ -name \\*.json -exec jq -r '.platforms.ios' {} \; | sort -un – Phill Z Jun 19 '21 at 19:08
  • 1
    Happy to be your 100th upvote! – Adam Pearlman Oct 05 '21 at 07:30
  • This is the perfect solution – Ali Aljabri Jun 20 '22 at 14:53
  • CMD+Shift+F and write `platforms": {` and scroll between all targets in your dir – Shalabyer Jun 23 '22 at 06:36
  • Solved it for me too. Interestingly, this was working fine on another computer but I only hit this issue after moving the project to a new computer. – Rik Aug 06 '22 at 03:48
  • Only the `pod update` worked for me. Thanks! – zackygaurav Mar 21 '23 at 12:32
  • This answer didn't work for me. It's clearly worked hundreds of others however. But I wanted to leave this comment to say it is f**king ridiculous that this is the fix for this issue -- open each .json file in the Pod folder and check the version number for the max, and then use that -- well done done @Preckrasno for figuring that out - but, seriously, WTF ?!? Why do we put up with this?!? – kris Aug 23 '23 at 08:11
117
pod update

Should do the trick.

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
Fahad S. Ali
  • 1,284
  • 1
  • 7
  • 7
44

On mac M1 (in ios folder), try arch -x86_64 pod update. Worked for me

Michał Dziwota
  • 838
  • 7
  • 16
12

I got a similar error:

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


What did not work for me:

As per the other answers, I went to the Podfile & updated:

  • from: # platform :ios, '9.0'
  • to: platform :ios, '13.0'

Then tried flutter run again but this time it was stuck at:

Running Xcode build....

The wait was unnatural & my patience grew thin so I discarded this change & looked for another solution.


Finally, What worked for me:

  1. flutter clean
  2. flutter pub get
  3. flutter run

No need to modify Podfile to specify a minimum ios target

staticVoidMan
  • 19,275
  • 6
  • 69
  • 98
  • 1
    Based on your answer, I tried the `flutter clean` version first. It did nothing. So I tried the `Podfile` version, and yes, the wait was unbearable!... But I went and had supper, and when I came back, I found that after 4,000 and something seconds, the project had built! – Karolina Hagegård Aug 01 '22 at 06:42
  • 1
    Oh... and the next time I built the project, it took 70 seconds. – Karolina Hagegård Aug 01 '22 at 06:44
10

I have a similar issue. Set Project, Target and Podfile to iOS 12 and get failure.

Here's my Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '12.0'
use_frameworks!

abstract_target 'all_pods' do
    pod 'Alamofire'
    pod 'AlamofireImage'
    pod 'AlamofireNetworkActivityIndicator'
    pod 'Atributika'
    pod 'AXPhotoViewer'
    pod 'Cache'
    pod 'Crashlytics'
    pod 'Fabric'
    pod 'Firebase/Core'
    pod 'Firebase/Messaging'
    pod 'Google-Mobile-Ads-SDK'
    pod 'GTMNSStringHTMLAdditions'
    pod 'KVLoading'
    pod 'MGSwipeTableCell'
    pod 'ReachabilitySwift'
    pod 'SDCAlertView'
    pod 'SideMenuSwift'
    pod 'SwiftyJSON'
    pod 'SwiftyUserDefaults'
    pod 'UIImageViewAlignedSwift'

target 'Test Poject' do
#    all_pods
end

end

First deintegrate to be sure

pod deintegrate

Run forced repo update

pod install --repo-update

Updating local specs repositories
$ /usr/bin/git -C /Users/XYZ/.cocoapods/repos/master fetch origin --progress
  remote: Counting objects: 9, done.        
  remote: Compressing objects: 100% (9/9), done.        
  remote: Total 9 (delta 6), reused 0 (delta 0), pack-reused 0        
  From https://github.com/CocoaPods/Specs
     8b2bcbd42ee..f72b5a3a02a  master     -> origin/master
  $ /usr/bin/git -C /Users/XYZ/.cocoapods/repos/master rev-parse --abbrev-ref HEAD
  master
  $ /usr/bin/git -C /Users/XYZ/.cocoapods/repos/master reset --hard origin/master
  HEAD is now at f72b5a3a02a [Add] DSJSONSchemaValidation 2.0.4

CocoaPods 1.6.0.beta.1 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.

For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.6.0.beta.1

Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "Firebase/Core":
  In Podfile:
    Firebase/Core

Specs satisfying the `Firebase/Core` dependency were found, but they required a higher minimum deployment target.
CocoaPods could not find compatible versions for pod "GoogleUtilities/MethodSwizzler":
  In Podfile:
    Firebase/Core was resolved to 5.8.0, which depends on
      FirebaseAnalytics (= 5.1.2) was resolved to 5.1.2, which depends on
        GoogleUtilities/MethodSwizzler (~> 5.2.0)

Specs satisfying the `GoogleUtilities/MethodSwizzler (~> 5.2.0)` dependency were found, but they required a higher minimum deployment target.
9

if you are running on Mac M1 (apple silicone chip) , try run this command :

arch -x86_64 pod install --repo-update 
Amer Alzibak
  • 1,489
  • 15
  • 16
7

For Mac with M1 chip (2022) :

What did the trick :

  • Change platform :ios, '9.0' to platform :ios, '11.0' in your Podfile file in <project>/ios/
  • Then update as follow : arch -x86_64 pod install --repo-update in your terminal (<project>/ios/)

All the dependencies and pods will be installed !

Enjoy !

Julien J
  • 2,826
  • 2
  • 25
  • 28
4

I had the same issue but this helped me.

pod 'Firebase/Core', '>= 0'
pod 'FirebaseCrashlytics', '>= 0'

It will update both FirebaseCore and FirebaseCrashlytics to the latest versions

Gurjinder Singh
  • 9,221
  • 1
  • 66
  • 58
4

just on pod file UnComment

# platform :ios, '9.0'

and replease it with platform :ios, '10.0'

then delete Podfile.lock and reInstall your app

Usama Elgendy
  • 506
  • 4
  • 8
3

These 3 steps worked for me.

  1. Upgrade cocoapods to latest version:

    sudo gem install cocoapods

  2. Delete /Pods folder and Podfile.lock file

  3. Run pod repo update

Mohammad Zaid Pathan
  • 16,304
  • 7
  • 99
  • 130
3

I had to update in Podfile.
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.0.0'.
to new version.
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.9.1'

Roman Nazarevych
  • 7,513
  • 4
  • 62
  • 67
3

For Those who have an Apple Mac with M1 chip :

-> try this sequence hope you see... pods are installing.

  1. sudo arch -x86_64 gem install ffi
  2. arch -x86_64 pod install or 
arch -x86_64 pod update
 or arch -x86_64 pod install --repo-update
amit.flutter
  • 883
  • 9
  • 27
2

This issue is coming from following line added to pod file. Alway make sure the tag is updated to the correct version here. Default version in the firebase documents are at times aged and should be updated to current version by checking it.

pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '7.11.0'

Read more on this from here.

Vivek
  • 437
  • 5
  • 12
1

I had this issue: enter image description here

To fix the problem, I opened the Podfile. Then

  1. I uncommented platform: ios, '8.0' and replaced it by platform :ios, '10.0', as mentioned in the other answers.

  2. I replaced the following code:

target 'Runner' do
  pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.3.0'
  use_frameworks!
  use_modular_headers!
  
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end

With this code:

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
  pod 'Firebase/Core'
  pod 'Firebase/Crashlytics'
  pod 'Firebase/Analytics'
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
      config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
      config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
      config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
    end
  end
end
  1. In Terminal, I ran the following command in the ios folder.
$ pod install

Everything went well. I didn't see any issue but a lot of green logs which basically are related to Installing FirebaseX... and at the end I got this message:

Pod installation complete! There are 8 dependencies from the Podfile and 24 total pods installed.
Hesam
  • 52,260
  • 74
  • 224
  • 365
1

To fix the problem (Intelli J)

  1. Check in IOS flutter folder Podfile.lock is generated.

  2. Run 'flutter doctor -v' to identify version of the Flutter,Dart,Xcode and CocoaPods version.

  3. Incase cocoa pods are not found, follow install commands.

    sudo gem uninstall cocoapods brew uninstall cocoapods

    sudo gem install cocoapods pod setup

  4. In Podfile - Uncommented platform: ios, '9.0' and replaced it by platform :ios, '10.0'.

  5. Run the build

    Launching lib/main.dart on iPhone 12 Pro Max in debug mode... Running pod install... Running Xcode build... Xcode build done.

enter image description here

Kranti K
  • 31
  • 1
1

I have solved this problem just by updating the platform version from the profile:

Go to iOS / Podfile:

Open Podfile

Uncomment the platform version:

# platform :ios, '9.0'  //Uncomment this line

To this:

platform :ios, '10.0'  //Uncomment & make version '9.0' to '10.0'

Boom !!! Solve the problem.

Md. Al-Amin
  • 690
  • 3
  • 13
0

I had a similar issue with firebase Admob and my problem was that I was using both admob_flutter and firebase_admob packages. Once I removed the admob_flutter package from pubspec.yaml and everything works perfectly!

JIJO J
  • 169
  • 3
  • 7
0

For me worked this:

  1. go to file %project%/ios/.symlinks/plugins/firebase_core/ios/firebase_sdk_version.rb
  2. change this def firebase_sdk_version!() '8.7.0' end for def firebase_sdk_version!() '8.5.0' end
  3. run pod install
Rafael
  • 1
0

There are two problems at the same time here. Cant update cocoa pods because of firebase dep. and can't update because of minimum deployment target.

Do:

  • pod reintegrate
  • uncomment the second line in pod file and elevate te platform: iOS to 11.0
  • pod update

that's the trick

Thiago Silva
  • 670
  • 6
  • 18
0

For me, the solution was:

  1. Bump NodeJS version from 16.0.0 to 16.5.1. To do so quickly, I'm using NVM.
  2. Install the Firebase CLI running npm install -g firebase-tools. Firebase CLI docs. My version is firebase-tools@11.0.1. If you have more packages, use npm list -g to list them, and then install them in the new NodeJS version.
  3. Run firebase login locally access your Firebase Console.
  4. [In your Flutter app's folder root] Run flutter clean & flutter pub get.
  5. Add Firebase Core (pub.dev) to your app and others Firebase's libraries.
  6. Run flutterfire configure to set up the connection between your app and Firebase.
  7. Initialize Firebase: steps
  8. Run your app.

PS. According to https://pub.dev/packages/firebase_core/versions, the min Dart is 2.16. Maybe you need to change it on your pubspec.yaml

Guillem Puche
  • 1,199
  • 13
  • 16
0

In my case I had to delete .symlinks, Podfile.lock, Podfile and start the app in Android Studio.

Kairat
  • 698
  • 1
  • 11
  • 14
0

Try this:

  1. Navigate to your ios folder (inside your flutter project).
  2. Then navigate to Pods/Local Podspecs/
  3. Then run this command: grep -rn "ios" *json.
  4. Remember the higher ios version.
  5. Navigate to PodFile in the ios directory of your project and make sure that this line appears: platform :ios, '<the higher ios version from step 3>'
tn2000
  • 642
  • 1
  • 8
  • 13
0
  1. Remove iOS/podlock
  2. pod install
Cem Sekiz
  • 31
  • 2
0

Just go to project's ios directory and run following command:

arch -x86_64 pod update

Note: It has been worked for me on MacOS M1, 2020 (apple silicone chip).

Muktadir Sony
  • 344
  • 4
  • 9
-2
#To your Podfile, add the Firebase pods that you want to use in your app.

platform :ios, ‘10.0’

# Add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'

# For Analytics without IDFA collection capability, use this pod instead
# pod ‘Firebase/AnalyticsWithoutAdIdSupport’

# Add the pods for any other Firebase products you want to use in your app
# For example, to use Firebase Authentication and Cloud Firestore
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
Saumil Shah
  • 2,299
  • 1
  • 22
  • 27
vitralyoz
  • 570
  • 7
  • 14