13

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?

POLAX
  • 131
  • 2
  • 1
    Maybe this will help: http://stackoverflow.com/questions/29481298/how-to-use-cocoapods-in-a-swift-framework – Hodson Nov 07 '16 at 10:32
  • could you show your podfile? – Tyler Rutt Apr 14 '17 at 13:37
  • Why are you building a framework for customized access (token) when Firebase already supports numerous login options as well as custom authentication using tokens? In other words, if you are going to add Firebase to your project anyway why also have it in a framework? Based on the data in your question it seems redundant - maybe clarifying the question will reveal better answers? – Jay Apr 20 '17 at 20:16

1 Answers1

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

?

Guig
  • 9,891
  • 7
  • 64
  • 126