Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 211
POLAX Avatar asked Nov 07 '16 10:11

POLAX


1 Answers

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

?

like image 193
Guig Avatar answered Oct 06 '22 06:10

Guig