CocoaPods recognizes "Firebase/Database (= 5.20.2)" as incompatible with "Firebase/Database"

Created on 4 May 2019  路  17Comments  路  Source: CocoaPods/CocoaPods

Report

What did you do?

  1. Run pod update locally
  2. Commit Podfile.lock
  3. Run pod install on CI

What did you expect to happen?

Install all pod dependencies correctly on CI.

What happened instead?

Error message:

Resolving dependencies of `Podfile`
[!] CocoaPods could not find compatible versions for pod "Firebase/Database":
  In snapshot (Podfile.lock):
    Firebase/Database (= 5.20.2)
  In Podfile:
    firebase_database (from `.symlinks/plugins/firebase_database/ios`) was resolved to 0.0.1, which depends on
      Firebase/Database
It seems like you've changed the constraints of dependency `Firebase/Database` inside your development pod `firebase_database`.
You should run `pod update Firebase/Database` to apply changes you've made.

CocoaPods Environment

Stack

   CocoaPods : 1.6.1
        Ruby : ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
    RubyGems : 2.5.2.3
        Host : Mac OS X 10.14.4 (18E226)
       Xcode : 10.2 (10E125)
         Git : git version 2.21.0
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 72773c8d4092b2731632d79bc0715a4b056f2e5e

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-deintegrate : 1.0.3
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.3.1
cocoapods-try         : 1.1.0

Project that demonstrates the issue

$ cat ios/.symlinks/plugins/firebase_database/ios/firebase_database.podspec
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
  s.name             = 'firebase_database'
  s.version          = '0.0.1'
  s.summary          = 'Firebase Database plugin for Flutter.'
  s.description      = <<-DESC
Firebase Database plugin for Flutter.
                       DESC
  s.homepage         = 'https://github.com/flutter/plugins/tree/master/packages/firebase_database'
  s.license          = { :file => '../LICENSE' }
  s.author           = { 'Flutter Team' => '[email protected]' }
  s.source           = { :path => '.' }
  s.source_files = 'Classes/**/*'
  s.public_header_files = 'Classes/**/*.h'
  s.ios.deployment_target = '8.0'
  s.dependency 'Flutter'
  s.dependency 'Firebase/Database'
  s.static_framework = true
end

Podfile.lock

PODS:
  <...>
  - Firebase/Database (5.20.2):
    - Firebase/CoreOnly
    - FirebaseDatabase (= 5.1.1)
  <...>
  - firebase_database (0.0.1):
    - Firebase/Database
    - Flutter

Most helpful comment

In that case, do pod repo update on the CI before the pod install to ensure the versions requested by the Podfile.lock are available.

All 17 comments

Running pod setup before pod install on CI fixes this issue, but I wonder why?

Please upload sample and provide Podfile.

Maybe your master repo is not setup?

@dnkoutso how do I verify whether my master repo is setup?

Here's a demo repo: https://github.com/dotdoom/cocoapodsdemo
It's almost pristine: made by flutter create, adding a couple firebase_* packages and running flutter build (the latter invokes pod install).

And here's a build giving a similar complaint about firebase_analytics:
https://cirrus-ci.com/task/5179201672970240.

The build also prints the latest commit to ~/.cocoapods/repos/master - if that's helping with master repo state. You can find it in the "meta" step of the CI output, along with pod env output (which I copied to the initial issue description).

You need to run pod setup to install the master specs repo

@dnkoutso you have to be more specific if you want to help me here :)

If I understand you correctly again, you're referring to https://github.com/CocoaPods/Specs.git. As you might have seen in the "meta" step of the build, the output from pod env insists that the master specs repo is installed:

Repositories : master - https://github.com/CocoaPods/Specs.git @ 72773c8d4092b2731632d79bc0715a4b056f2e5e

Any other ideas?

@dotdoom Are you able to provide a repro that doesn't require flutter to be installed?

If not, what are the minimal repro steps for someone who doesn't have flutter installed?

@paulb777 since I never used Cocoapods or Xcode, it took some time. Here's a stripped down sample, without any dependency apart from XCode and Cocoapods, broken down by commit:

https://github.com/dotdoom/cocoapodsdemo

And failure: https://cirrus-ci.com/task/5657235492438016

To reproduce this locally, run the following in the checked out directory:

$ git -C ~/.cocoapods/repos/master checkout 72773c8d4092b2731632d79bc0715a4b056f2e5e
$ pod install

@dotdoom The problem is the git command - it reverts ~/.cocoapods/repos/master back to the March 26th version which is when 5.19.0 was the latest version of Firebase. CocoaPods is behaving as expected for its inputs. @dnkoutso was correct in that this issue results from an out-of-date master repo setup.

Some details of the git repo after the git command:

~/.cocoapods/repos/master $ git log | head
commit 72773c8d4092b2731632d79bc0715a4b056f2e5e
Author: Twilio, Inc ios-sdks@twilio.com
Date: Tue Mar 26 14:11:44 2019 -0400

[Add] TwilioAuth 1.2.5

commit a28afd5a2d046814759095051a6e0b6482364a6e
Author: Wolf McNally wolf@wolfmcnally.com
Date: Tue Mar 26 14:09:44 2019 -0400

~/.cocoapods/repos/master $ ls -l ./Specs/0/3/5/Firebase/5.19.0
total 16
-rw-r--r-- 1 paulb primarygroup 5739 Mar 19 15:02 Firebase.podspec.json
~/.cocoapods/repos/master $ ls -l ./Specs/0/3/5/Firebase/5.20
ls: ./Specs/0/3/5/Firebase/5.20: No such file or directory
~/.cocoapods/repos/master $ git checkout master
Checking out files: 100% (11424/11424), done.
Previous HEAD position was 72773c8d409 [Add] TwilioAuth 1.2.5
Switched to branch 'master'
Your branch is behind 'origin/master' by 141 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
~/.cocoapods/repos/master (master) $ git pull
Updating f21a9dadbd2..826b5370bfd
Fast-forward
__
~/.cocoapods/repos/master (master) $ ls -l ./Specs/0/3/5/Firebase/5.20

./Specs/0/3/5/Firebase/5.20.0:
total 16
-rw-r--r-- 1 paulb primarygroup 5739 May 5 06:31 Firebase.podspec.json

./Specs/0/3/5/Firebase/5.20.1:
total 16
-rw-r--r-- 1 paulb primarygroup 5739 May 5 06:31 Firebase.podspec.json

./Specs/0/3/5/Firebase/5.20.2:
total 16
-rw-r--r-- 1 paulb primarygroup 5739 May 5 06:31 Firebase.podspec.json

Thanks @paulb777. The git command puts the master repo to the same state as it is on CI.
I have 2 questions:

  1. Is there a known solution to this problem?
  2. The error message is really misleading and gives no clue. Is there any chance to improve it?

One solution would be to run pod update instead of pod install on CI to insure the master repo is up to date.

Wouldn't pod update change versions in Podfile.lock? This doesn't sound like something I'd want to do on CI & CD.

In that case, do pod repo update on the CI before the pod install to ensure the versions requested by the Podfile.lock are available.

Great, that works - thank you. Should I create a separate issue for the misleading error message?

Sounds good! Thanks for following up with the simple reproducible example. It made it much easier to diagnose. :)

Yep - a separate ticket focusing on the misleading error message would be helpful.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iosdev-republicofapps picture iosdev-republicofapps  路  3Comments

sonu5 picture sonu5  路  3Comments

pallaviMN picture pallaviMN  路  3Comments

gerchicov-bp picture gerchicov-bp  路  3Comments

marzapower picture marzapower  路  3Comments