“No such module 'Firebase'” when add Firebase into a library

点点圈 提交于 2021-02-07 11:48:15

问题


I just created new Framework and added Firebase via CocoaPods, when combine the library it success.

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'

Anyone faced a problem like this?


回答1:


You need to add the follwing to your POD file:

pod 'Firebase'

After that, you need to type in your terminal

pod install (to refresh the pod file)




回答2:


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 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:

s.static_framework = true

s.dependency 'Firebase'
s.dependency 'Firebase/Core'

It works for me!




回答3:


Do you open the workspace file after installed with cocoa pods ?

Check if library is added in "Linked Frameworks" or "Embedded Binaries"

If it didn't work, add this pod file

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.




回答4:


For me I had to change the version specified in the Podfile as it was above what my app supported. Specifically in the Podfile I changed: 'platform :ios, '11.0' to platform :ios, '10.0' which corresponds with Deployment Info in the General Tab for my app I'm working on.




回答5:


For Flutter folks adding Firebase to their apps, make sure you follow the steps in Add Firebase to your iOS Project as well as those in the SDK setup steps in the Firebase Console:

In summary:

  1. Run pod init if you don't have a pod file

  2. Add the necessary pods to the bottom of the podfile. All possible Firebase pods can be found here.

    pod 'Firebase/Analytics' pod 'Firebase/Firestore' pod 'Firebase/Auth' pod 'Firebase/Storage'

  3. Run pod install




回答6:


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


来源:https://stackoverflow.com/questions/37850498/no-such-module-firebase-when-add-firebase-into-a-library

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