3

Now that the iOS Firebase SDK is open-source, I'd like to build a pod using Firebase as a dependency. To do so, I create a new pod template with the following.

My issue is that I can import FirebaseDev from the example project, but I cannot from my development pod. I knew this was an issue before the SDK got open-source, but I hope to be able to fix this issue now but I need help identifying where the problem lies. Anyone can help on this?

.podspec:

s.dependency 'FirebaseDev'
s.dependency 'FirebaseDev/Core'
s.dependency 'FirebaseDev/Auth'
s.dependency 'FirebaseDev/Database'

Example/Podfile:

pod 'FirebaseDev', :git => 'https://github.com/firebase/firebase-ios-sdk'
pod 'FirebaseDev/Core', :git => 'https://github.com/firebase/firebase-ios-sdk'
pod 'FirebaseDev/Auth', :git => 'https://github.com/firebase/firebase-ios-sdk'
pod 'FirebaseDev/Database', :git => 'https://github.com/firebase/firebase-ios-sdk'
Mick F
  • 7,312
  • 6
  • 51
  • 98
  • There's a space before the name of the Pod in that string, it's worth raising an issue that CocoaPods should trim strings like that, – orta May 31 '17 at 17:32
  • Also, it's probably easier for you to write `pod 'FirebaseDev', :git => 'https://github.com/firebase/firebase-ios-sdk', subspacs: ["Core", "Auth", "Database"]` – orta May 31 '17 at 18:50
  • Ha ha thanks @orta for fixing my stupid typo. Will fix the question but the problem remains the same. – Mick F Jun 01 '17 at 08:03

2 Answers2

5

A little late but, in your .podspec add s.static_framework = true. That'll let you use Firebase as a pod dependency!

Alex Mason
  • 385
  • 1
  • 5
  • 11
2

Following some advice on the linked GitHub issue, I created a fork of firebase-ios-sdk in which I only removed the modulemap file and I was finally able to create a Pod using Firebase as a dependency! Youhou!!!

I need to find out if this has some nasty side-effects now.

Update: the corresponding pull request has been merged.

Mick F
  • 7,312
  • 6
  • 51
  • 98
  • sorry if I'm dense, but I don't see how I can use `FirebaseDev` as a dependency, as it's not available as a cocoa pod? It's not possible to specify git or spec location in the `.podspec` – Henrik Hartz Jun 21 '17 at 08:56
  • It is available as a cocoapod. The podspec can't be used to specify the location of the pod, but if you set it in the Example/Podfile, the podspec will be satisfied, just as showcased in my question. If you don't have an example app along your pod, i'm not sure how you can tell podspec where to find the pod. – Mick F Jun 21 '17 at 16:40
  • Cf. this discussion for more information on the subject: https://github.com/CocoaPods/CocoaPods/issues/2937#issuecomment-66810839 – Mick F Jun 21 '17 at 16:41
  • FirebaseDev has been renamed to FirebaseCommunity and is now pushed to CocoaPods trunk. – Paul Beusterien Jun 24 '17 at 23:35