CocoaPods stopped installing Firebase/Analytics with error

为君一笑 提交于 2020-12-15 04:55:08

问题


I've installed Firebase/Analytics into an iOS Project yesterday (as I've done many times before) and today I wanted to add Firebase/Crashlytics and suddenly both of them don't work anymore.

I get the following error message:

[!] CocoaPods could not find compatible versions for pod "Firebase/Crashlytics": In Podfile: Firebase/Crashlytics (= 4.0.0)

There are other pods (e.g. GoogleMaps, Resolver, Alamofire, etc) which work fine. Just the Firebase/* stuff doesn't work.

If I remove the / and try to install FirebaseAnalytics and FirebaseCrashlytics it works (the pod install does at least) but then xCode tells me it cannot find the Firebase module.

Here is my pod env

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

Stack

   CocoaPods : 1.9.1
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
    RubyGems : 3.0.3
        Host : Mac OS X 10.15.4 (19E287)
       Xcode :  ()
         Git : git version 2.24.2 (Apple Git-127)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : cocoapods - git - https://github.com/CocoaPods/Specs.git @ 8fd5e2704f3952940bbdb6fcc7dc6c138594e6ff

               trunk - CDN - https://cdn.cocoapods.org/

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.4.1
cocoapods-try         : 1.2.0

Podfile

# workspace 'project.xcworkspace'
platform :ios, '11.0'
use_frameworks!

# Pods for project
pod 'Resolver', '1.1.2'
pod 'GoogleMaps', '3.8.0'
pod 'GooglePlaces', '3.8.0'

pod 'Alamofire', '5.0.0-rc.2'
pod 'AlamofireObjectMapper', '6.2'
pod 'AlamofireNetworkActivityLogger', '3.0'

pod 'Firebase/Crashlytics', '4.0.0'
pod 'Firebase/Analytics', '6.4.2'

target 'project' do
  # any project specific pods
end

I'm at a bit of a loss here and any hints would be greatly appreciated.


回答1:


Remove the slashes from Firebase/Crashlytics and Firebase/Analytics.

The slash indicates a subspec of the Firebase pod.

You could also leave the slash and specify the version of the last Firebase pod - 6.23.0.




回答2:


It's because of version conflict.

use pod 'Firebase/Crashlytics' with slash and without version. (or newest version)

and run pod update Firebase/Crashlytics Firebase/Analytics

if you have other version conflict, run pod update Firebase/Crashlytics Firebase/Analytics GoogleXXX(s)



来源:https://stackoverflow.com/questions/61496402/cocoapods-stopped-installing-firebase-analytics-with-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!