ios Cocoapods:无法找到“Firebase/Core”的规范

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/40102061/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 10:36:32  来源:igfitidea点击:

Cocoapods: Unable to find a specification for `Firebase/Core`

iosswiftfirebasecocoapods

提问by Mirza Delic

I have this in podfile:

我在 podfile 中有这个:

pod 'Firebase/Core'
pod 'Firebase/Messaging'

but getting this error:

但收到此错误:

[!] Unable to find a specification for Firebase/Core

[!] 无法找到规范 Firebase/Core

i tried with pod 'Firebase'still can't find it.

我试过了pod 'Firebase'还是找不到。

Podfile:

播客文件:

# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!

target 'caffetouch manager' do
    pod 'Firebase/Core'
    pod 'Firebase/Messaging'
    pod 'Alamofire', '~> 4.0.0'
    pod 'AlamofireNetworkActivityIndicator', '~> 2.0.1'
    pod 'IQKeyboardManagerSwift', '~> 4.0.6'
    pod 'MZFormSheetPresentationController', '~> 2.4.2'
    pod 'Kingfisher', '~> 3.1.3'
    pod "GMStepper"
    pod 'DKImagePickerController', '~> 3.4.0'
    pod 'Siren', '~> 1.0.2'
    pod 'Eureka', '~> 2.0.0-beta.1'
    pod 'SwiftyJSON'
    pod 'ObjectMapper', '~> 2.1'
    pod 'NVActivityIndicatorView'
    pod 'SwiftDate', '~> 4.0.5'
    pod 'SimpleAlert' '~> 2.0.1'

    pod 'BTNavigationDropdownMenu', :git => 'https://github.com/PhamBaTho/BTNavigationDropdownMenu.git', :branch => 'swift-3.0'
    pod 'ENSwiftSideMenu', :git => 'https://github.com/evnaz/ENSwiftSideMenu.git', :branch => 'master'
    pod 'SkyFloatingLabelTextField', git: "https://github.com/MLSDev/SkyFloatingLabelTextField.git", branch: "swift3"
end


post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '3.0'
    end
  end
end

回答by Piotr Labunski

Try to update pod repository

尝试更新 pod 存储库

pod repo update

If doesn't help show log from

如果没有帮助显示日志

pod install --verbose

Edit:

编辑:

try to add

尝试添加

source 'https://github.com/CocoaPods/Specs.git'

to your Podfile. If doesn't help probably there is a problem with your local pod repo. You can fix this using:

到您的 Podfile。如果没有帮助,您的本地 pod 存储库可能存在问题。您可以使用以下方法解决此问题:

pod repo remove master
pod setup
pod install

回答by Rajesh.k

try below commands:

尝试以下命令:

pod repo remove master
pod repo update
pod install --verbose

回答by steve-o

This worked for me by updating cocoapods and my pod repo:

这通过更新 cocoapods 和我的 pod repo 对我有用:

sudo gem install cocoapods
pod repo update

回答by Yoni Katz

try to delete the file podfile.lock
it helps with issue:

尝试删除podfile.lock
有助于解决问题的文件:

[!] CocoaPods could not find compatible versions for pod "Firebase/Core":
In snapshot (Podfile.lock):
Firebase/Core (= 4.8.1)

[!] CocoaPods 找不到 pod“Firebase/Core”的兼容版本:
在快照中 (Podfile.lock):
Firebase/Core (= 4.8.1)

回答by ronatory

Check if your podfile looks like this and then execute pod install:

检查您的 podfile 是否如下所示,然后执行pod install

platform :ios, '10.0'
use_frameworks!

target '<YOUR APP TARGET>' do

  # Firebase
  pod 'Firebase'
  pod 'Firebase/Core'
  pod 'Firebase/Messaging'

end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '3.0'
    end
  end
end

回答by AbbasAngouti

None of the approaches mentioned worked for me. Here is how I made it to work, however:

提到的方法都不适合我。然而,这是我让它工作的方式:

  1. Comment out all of your pods in your Podfile.
  2. Comment them back in one-by-one and run pod installafter each
  3. Clean and run
  1. 注释掉你在你的Podfile.
  2. 一一评论它们并pod install在每个之后运行
  3. 清洁并运行

I hope it will help somebody.

我希望它会帮助某人。

回答by Ajitpaulm

If it still doesn't work, remove cocoapods directory rm -rf ~/.cocoapodsand re-setup cocoapods using pod setup

如果它仍然不起作用,请删除 cocoapods 目录rm -rf ~/.cocoapods并使用重新设置 cocoapodspod setup

Hope that helps

希望有帮助

回答by Catarino

had the same problem.

有同样的问题。

what really worked for me was gem uninstall cocoapodswhere I found that I had 11 (!) cocoapods versions. I chose to uninstall all and then gem install cocoapods:1.4.0

真正对我有用的是gem uninstall cocoapods我发现我有 11 个 (!) cocoapods 版本。我选择全部卸载然后gem install cocoapods:1.4.0

All good now.

现在一切都很好。