【问题标题】:Cocoapods: Unable to find a specification for `Firebase/Core`Cocoapods:找不到“Firebase/Core”的规范
【发布时间】:2017-02-27 08:41:59
【问题描述】:

我在 podfile 中有这个:

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

但收到此错误:

[!] 找不到 Firebase/Core 的规范

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

Pod 文件:

# 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

【问题讨论】:

  • 你可以在这里添加你的整个 pod 文件以获得确切的想法。
  • 更新了@DarshanKunjadiya

标签: ios swift firebase cocoapods


【解决方案1】:

尝试更新 pod 仓库

pod repo update

如果没有帮助显示来自的日志

pod install --verbose

编辑:

尝试添加

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

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

pod repo remove master
pod setup
pod install

【讨论】:

  • Genius - 最后一组说明解决了这个问题。可能与 Unity 在我有机会之前尝试设置 pod 有关。
  • 我也遇到了这种情况并通过删除PodsPodfile.lock然后重新运行pod install来修复它
  • 是的,有时它会有所帮助。如果您删除 Pods 文件夹和 Podfile.lock 您也可以删除 workspace 文件。会再次生成
  • Denle una cheve a este campeon
【解决方案2】:

尝试以下命令:

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

【讨论】:

    【解决方案3】:

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

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

    【讨论】:

    • 能否请您写下删除锁定文件的具体作用?会不会有副作用?
    • 删除 pod 锁定文件可能会破坏项目并且可能是灾难性的,因为较新版本的 pod 可能已更改。这样做需要对每个更新的 pod 进行适当的迁移。
    【解决方案4】:

    检查你的 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
    

    【讨论】:

    • 我用我的 podfile 更新了问题,我尝试了你的解决方案,但还是一样。它找不到 Firebase。
    【解决方案5】:

    通过更新 cocoapods 和我的 pod 存储库,这对我有用:

    sudo gem install cocoapods
    pod repo update
    

    【讨论】:

      【解决方案6】:

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

      1. 注释掉您在Podfile 中的所有 pod。
      2. 评论他们回来 一个接一个并在每个之后运行pod install
      3. 清理并运行

      我希望它会对某人有所帮助。

      【讨论】:

        【解决方案7】:

        如果还是不行,删除 cocoapods 目录 rm -rf ~/.cocoapods 并使用 pod setup 重新设置 cocoapods

        希望有帮助

        【讨论】:

        • 是的。如果你的 cocoapod git repo 不好。这将起作用。因为我的仓库没有更新。
        【解决方案8】:

        有同样的问题。

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

        现在一切都好。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2017-03-19
          • 1970-01-01
          • 1970-01-01
          • 2014-11-12
          • 1970-01-01
          • 2017-08-21
          • 2019-02-23
          相关资源
          最近更新 更多