xcode 将 Firebase 添加到库中时“没有这样的模块‘Firebase’”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37850498/
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
"No such module 'Firebase'" when add Firebase into a library
提问by Tai Le
I just created new Framework and added Firebase via CocoaPods, when combine the library it success.
我刚刚创建了新框架并通过 CocoaPods 添加了 Firebase,当合并库时它成功了。
But when I add that library to other project via CocoaPods as well, then combine that project, and it raise an error: No such module 'Firebase'
但是当我也通过 CocoaPods 将该库添加到其他项目时,然后组合该项目,并引发错误: No such module 'Firebase'
Anyone faced a problem like this?
有人遇到过这样的问题吗?
回答by Bruno Ramos
I solve my problem using just the specific import
that I'm using, for example.
In my SDK I'm using FirebaseCore and FirebaseAnalytics.
Into my class I just import:
import
例如,我仅使用我正在使用的特定内容来解决我的问题。在我的 SDK 中,我使用 FirebaseCore 和 FirebaseAnalytics。在我的班级中,我只需导入:
import FirebaseCore
import FirebaseAnalytics
And in my .podspec I needed to set static_framework
property to true, so my .podspec it's seems like code below:
在我的 .podspec 中,我需要将static_framework
属性设置为 true,所以我的 .podspec 看起来像下面的代码:
s.static_framework = true
s.dependency 'Firebase'
s.dependency 'Firebase/Core'
It works for me!
这个对我有用!
回答by Christian Mora
You need to add the follwing to your POD file:
您需要将以下内容添加到您的 POD 文件中:
pod 'Firebase'
pod 'Firebase'
After that, you need to type in your terminal
之后,您需要在终端中输入
pod install
(to refresh the pod file)
pod install
(刷新pod文件)
回答by Bram'in
Do you open the workspace file after installed with cocoa pods ?
安装 cocoa pods 后是否打开工作区文件?
Check if library is added in "Linked Frameworks" or "Embedded Binaries"
检查库是否添加到“链接框架”或“嵌入式二进制文件”中
If it didn't work, add this pod file
如果它不起作用,请添加此 pod 文件
platform :ios, '8.0' use_frameworks! target ‘Your Project' do
pod 'Firebase', '>= 2.5.1'
pod ‘Firebase/Auth'
pod ‘Google/SignIn'
pod ‘Firebase/Database'
pod 'Firebase/Storage' end
and then type pod - reintegrate
and after pod install
.
然后输入pod - reintegrate
和之后pod install
。
回答by Pritesh Desai
The same thing happened to me last week. I solved it by:
上周同样的事情发生在我身上。我通过以下方式解决了它:
1. pod deintegrate
2. Open Xcode and delete any instance of pod.
3. pod install