【发布时间】:2016-09-25 21:23:47
【问题描述】:
我正在尝试通过 CocoaPods 为我的 Objective-C iOS 应用程序安装 Firebase。我的 Podfile 如下:
target 'RandomName' do
pod 'Firebase/Core'
pod 'Firebase/AdMob'
end
当我运行pod install 时,我收到以下错误:
[!] Unable to satisfy the following requirements:
- `Firebase/Core` required by `Podfile`
None of your spec sources contain a spec satisfying the dependency: `Firebase/Core`.
You have either:
* out-of-date source repos which you can update with `pod repo update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.
已安装最新版本的 CocoaPods,我尝试运行 pod repo update。拥有以下 Podfile 可以正常工作,但是当我尝试在我的 AppDelegate.m 文件中使用 @import Firebase; 时,Xcode 找不到该模块。
target 'RandomName' do
pod 'Firebase'
end
但是,以下组合无法安装:
target 'RandomName' do
pod 'Firebase'
pod 'Firebase/AdMob'
end
任何帮助将不胜感激!
【问题讨论】:
-
在 podfile 中使用 pod 'Firebase' 并在将 Firebase 导入为 @import Firebase 之后;你建立这个项目吗?如果没有,请尝试构建它。因为 Xcode 抱怨找不到模块,但在构建时错误消失了。当我集成其他一些框架时,我遇到了类似的问题并花了几个小时在上面。但建成后它开始工作。因此,您可能也会遇到同样的情况。
标签: ios objective-c firebase firebase-realtime-database cocoapods