How do I Integrate the Firebase cocoaPods in my custom swift framework?

送分小仙女□ 提交于 2019-12-23 07:10:28

问题


I want to build a iOS swift framework (ex. XYZ) which for users to login firebase with customized access token. I finished my login method and get the access token in XYZ. Now I want to Integrate the Firebase in XYZ to pass the access token to Firebase. So I install Firebase in XYZ with cocoaPods. and write the code and build a XYZ framework. Everything seems fine.

Than I create a swift project ABC, and import XYZ framework. Then I got error "Missing required module 'Firebase' " at the line I import XYZ.

If I also install Firebase in ABC with cocoaPods. It will run successfully but get many errors about "Class FirebaseXXX is implemented in both ABC and XYZ. One of the two will be used. Which one is undefined." And Crash soon.

Would Someone please help me to figure it out how to fix this problem?


回答1:


Have you tried a podfile like:

platform :ios, '9.0'

target 'ABC' do
  use_frameworks!
  workspace 'ABC'
  project 'ABC'

  pod 'Firebase'
  # ...
end

target 'XYZ' do
    use_frameworks!
    workspace 'ABC'
    project 'XYZ'

    # pods for the framework
    pod 'Firebase'
    # ...
end

?



来源:https://stackoverflow.com/questions/40462883/how-do-i-integrate-the-firebase-cocoapods-in-my-custom-swift-framework

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