Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CocoaPods could not find compatible versions for pod “Firebase/CoreOnly” #32389

Closed
panthe opened this issue May 9, 2019 · 23 comments
Closed

Comments

@panthe
Copy link

panthe commented May 9, 2019

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
@rogiervandenberg
Copy link

I have the same thing after upgrading Flutter, but with a slightly different error where it stops.

  • Create shiny new project to test: flutter create appletest
  • Drop in the latest firebase plugins:
dependencies:
  flutter:
    sdk: flutter
  firebase_core: ^0.4.0
  firebase_analytics: ^3.0.0
  firebase_auth: ^0.11.0
  cloud_firestore: ^0.11.0+1
  cloud_functions: ^0.3.0
  • and build iOS: flutter build ios

results in:

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-release`
    -> Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
    -> Fetching podspec for `cloud_functions` from `.symlinks/plugins/cloud_functions/ios`
    -> Fetching podspec for `firebase_analytics` from `.symlinks/plugins/firebase_analytics/ios`
    -> Fetching podspec for `firebase_auth` from `.symlinks/plugins/firebase_auth/ios`
    -> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`

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

    Specs satisfying the `Firebase/Functions (~> 5.18)` dependency were found, but they required a higher minimum
    deployment target.

My Flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.4 18E226, locale en-NL)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.33.1)
[!] Connected device
    ! No devices available

! Doctor found issues in 1 category.

@dvird
Copy link

dvird commented May 9, 2019

+1

1 similar comment
@FuNnaji
Copy link

FuNnaji commented May 10, 2019

+1

@panthe
Copy link
Author

panthe commented May 12, 2019

The problem is in cloud_functions plugins.
They have 5.18 version of Firebase.
For fix it you must change manually the file cloud_functions.podspec in the ios folder of the plugin while their doesn't finally fix.

Change it

s.dependency 'Firebase/Firestore', '~> 5.18'

to

s.dependency 'Firebase/Firestore', '~> 6.0'

After that still remaing an error regarding some missed dependencies of Firebase functions files.

I add directly in the pod this line:

pod 'Firebase/Functions'

I know that all this is an workaround but works in this way for me.

@lambasoft
Copy link

+1

@rwozniak
Copy link

In my case running pod repo update from the ios directory helped to fix the issue.

@adriancmurray
Copy link

adriancmurray commented May 15, 2019

Neither of the suggested workarounds fixed it for me but this one did: https://stackoverflow.com/a/56080232/9910719

@colatusso
Copy link

pod update did the trick for me.

@BondarenkoStas
Copy link

@panthe Please report if the issue is still relevant without workaround?

@BondarenkoStas BondarenkoStas added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 12, 2019
@panthe
Copy link
Author

panthe commented Sep 15, 2019

I have try now and I think that the workaround is not relevant anymore.

@panthe panthe closed this as completed Sep 15, 2019
@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 15, 2019
@mliitfall
Copy link

Just delete podfile.lock work for me

@jspkm
Copy link

jspkm commented Feb 11, 2020

pod update did the trick for me.

This worked for me. Thanks @colatusso!

@aardrop
Copy link

aardrop commented Sep 11, 2020

pod update did the trick for me.

This worked for me after adding the highest ios version dependency from the symlinks/plugins in the Podfile platform :ios, '11.0'

@eyale
Copy link

eyale commented Sep 14, 2020

pod update did the trick for me.

....for me too, thanks mate!
Update updating existing pods, removing unnecessary pods, so you don't need to run pod install again.

@emptyopen
Copy link

(1) delete podfile.lock (if you are getting complaints about conflicting package versions, especially)
(2) pod update

@MeshkaniMohammad
Copy link

MeshkaniMohammad commented Jan 22, 2021

If you got the following error:

  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.

Just go to Podfile and update the minimum deployment target (in my case it was 9.0 and i changed it to 10.0).

@erf
Copy link

erf commented Jan 25, 2021

I had a similar problem and fixed it by updating the min ios version in the Podfile:

platform :ios, '10.0'

@eademir
Copy link

eademir commented Mar 8, 2021

i had similar problem and i couldn't fix it for a while. i deleted firebase_analytics from pubspec.yaml and it's working.

@lane-faison
Copy link

lane-faison commented Mar 11, 2021

  1. platform :ios, '10.0'
  2. pod update
  3. flutter clean
  4. flutter build ios

@yuchar
Copy link

yuchar commented Mar 13, 2021

  1. platform :ios, '10.0'
  2. pod update
  3. flutter clean
  4. flutter build ios

Thanks @lane-faison

@Sukendh
Copy link

Sukendh commented May 11, 2021

Uncomment this line to define a global platform for your project
platform :ios, '11.0'

do this in your pod file. It worked for me.

@flutterq

This comment was marked as spam.

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests