CocoaPods could not find compatible versions for pod "Firebase/CoreOnly"

68,336

Solution 1

Try calling pod repo update

if the issue is not fixed

delete the Podfile.lock in the root directory, after that run pod install

Solution 2

Edit the minimum ios version in the podfile then run pod install.

Changing platform :ios, '9.0' to platform :ios, '10.0' then running pod install fixed it for me.

Solution 3

🌟 For M1 Mac Users 

  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 step 2. - for example 10.0.

then here comes the M1 specific part

  1. Run sudo arch -x86_64 gem install ffi

  2. Run arch -x86_64 pod repo update

  3. Run arch -x86_64 pod install error should be gone



  1. If using Flutter cd - back to your root directory - open iOS Simulator & run flutter run



  10. ENJOY !🌟 



If not working you might need to run flutter pub add firebase_coreto add firebase_core to your pubspec.yaml file Before Step 1




If still not working try this BONUS STEPS :

  • Trying to Run directly from Xcode ? First Run flutter build iOS in your Flutter project -> then Run in Xcode

  • Still not working cd iOS run rm -rf Pods/ Podfile.lock ; pod install

  • Still not working ? Search Keychain Access in Spotlight -> open -> Right-click on login -> Unlock (you will lock back when build succeeds)

  • Still not working ? Xcode Runner Info Screenshot make sure your Runner Info Configs look like this



Hope this helps ! Comment down bellow if still facing issues !

Solution 4

Just do a pod update and then pod install. This worked for me.

Solution 5

  1. Execute flutter clean

  2. Go to ios/ folder, edit Podfile and choose the platorm and version you want to launch. For example for platform ios and version 12.0 :

Podfile

# Uncomment this line to define a global platform for your project
platform :ios, '12.0'
  1. Execute pod update

  2. Execute pod install (it can take a some minutes to download dependencies)

  3. Execute flutter run

Share:
68,336
Luca Panteghini
Author by

Luca Panteghini

I'm a senior developer and I like open source, Android and web developing. I try to continuously improve my knowledge and my skill.

Updated on February 20, 2022

Comments

  • Luca Panteghini
    Luca Panteghini over 2 years

    I've update my flutter package to the last versions and now IOS doesn't work anymore.

    When I try to update the pods it's shows this error:

        [!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
        In Podfile:
        cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on
        Firebase/Firestore (~> 6.0) was resolved to 6.0.0, which depends on
        Firebase/CoreOnly (= 6.0.0)
    
        cloud_functions (from `.symlinks/plugins/cloud_functions/ios`) was resolved to 0.0.1, which depends on
        Firebase/Functions (~> 5.18) was resolved to 5.18.0, which depends on
        Firebase/CoreOnly (= 5.18.0)
    

    Here my pubspec.yaml (Firebase related):

    firebase_core: "^0.4.0"
    firebase_auth: "^0.11.0"
    firebase_analytics: "^3.0.0"  
    cloud_firestore: "^0.11.0+1"
    cloud_functions: "^0.3.0"
    firebase_storage: "^3.0.0"
    firebase_messaging: "^5.0.1"
    

    I've made various steps to try to fix:

    flutter clean
    flutter build ios
    
    pod install
    pod update
    pod repo update
    pod install --repo-update
    

    I've set platform :ios, '12.1' in Podfile and in Xcode as build target but nothing come back to works.

    Here my podfile:

    # Uncomment this line to define a global platform for your project
    platform :ios, '12.1'
    
    # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
    ENV['COCOAPODS_DISABLE_STATS'] = 'true'
    
    project 'Runner', {
      'Debug' => :debug,
      'Profile' => :release,
      'Release' => :release,
    }
    
    def parse_KV_file(file, separator='=')
      file_abs_path = File.expand_path(file)
      if !File.exists? file_abs_path
        return [];
      end
      pods_ary = []
      skip_line_start_symbols = ["#", "/"]
      File.foreach(file_abs_path) { |line|
          next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
          plugin = line.split(pattern=separator)
          if plugin.length == 2
            podname = plugin[0].strip()
            path = plugin[1].strip()
            podpath = File.expand_path("#{path}", file_abs_path)
            pods_ary.push({:name => podname, :path => podpath});
          else
            puts "Invalid plugin specification: #{line}"
          end
      }
      return pods_ary
    end
    
    target 'Runner' do
      use_frameworks!
    
      # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
      # referring to absolute paths on developers' machines.
      system('rm -rf .symlinks')
      system('mkdir -p .symlinks/plugins')
    
      # Flutter Pods
      generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
      if generated_xcode_build_settings.empty?
        puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
      end
      generated_xcode_build_settings.map { |p|
        if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
          symlink = File.join('.symlinks', 'flutter')
          File.symlink(File.dirname(p[:path]), symlink)
          pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
        end
      }
    
      # Plugin Pods
      plugin_pods = parse_KV_file('../.flutter-plugins')
      plugin_pods.map { |p|
        symlink = File.join('.symlinks', 'plugins', p[:name])
        File.symlink(p[:path], symlink)
        pod p[:name], :path => File.join(symlink, 'ios')
      }
    end
    
    post_install do |installer|
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['ENABLE_BITCODE'] = 'NO'
        end
      end
    end
    
  • emrcftci
    emrcftci over 3 years
    rm -rf Podfile.lock then pod install worked for me.
  • Julian Schmuckli
    Julian Schmuckli about 3 years
    Worked perfect, when I have changed it in Xcode under "Runner" -> "Runner" -> "Info" -> "iOS Deployment Target" to version >= 10.0.0
  • Ajay Gautam
    Ajay Gautam about 3 years
    For M1 macs: alias pod="arch -x86_64 pod"
  • easeccy
    easeccy over 2 years
    Thanks. Step 6,7 and 8 solved the issue for me on an M1 Mac.
  • Mohammed_7aafar
    Mohammed_7aafar over 2 years
    thanks alot it worked for me because I'm m1 user.
  • Engin Yilmaz
    Engin Yilmaz over 2 years
    I got "bad cpu type" error on step 6 so that I installed the ffi by running this command "arch -x86_64 brew install libffi" if I am not wrong than this command also install the ffi
  • Huthaifa Muayyad
    Huthaifa Muayyad over 2 years
    HERO, took two days to figure out the M1 settings, although they were working on M1 but for some reason it stoped. And pod install or update never worked again until those methods. Thanks again.
  • Karatekid430
    Karatekid430 about 2 years
    If you are having to run any pod installs inside Rosetta then your machine is not set up correctly.
  • Noshaid Ali
    Noshaid Ali about 2 years
    Also if you are developing a react-native application using yarn run yarn add all
  • Ashonko
    Ashonko about 2 years
    Thanks a lot. Hovering here and there with different solutions but yours finally solved my problem on M1.
  • Faiizii Awan
    Faiizii Awan about 2 years
    flutter 3 not working for me
  • tcffm
    tcffm almost 2 years
    Thanks a lot, you saved my day! Worked on my M1.