4

We've been migrating away from CocoaPods since a while, but not every dependency has made the switch. Like Firebase.

I've had a similar question regarding duplicate symbols, but now I'm facing something new, which is probably because I'm using a dependency in both SwiftPM as in CocoaPods.

After running my (sample) project it crashes:

-[FBLPromise firebaseInstallationID]: unrecognized selector sent to instance 0x600003f5a430

with a warning at the top:

objc[93047]: Class FBLPromise is implemented in both
/xxx/SampleProject.app/Frameworks/FBLPromises.framework/FBLPromises (0x10b3f09a8) and 
/xxx/SampleProject.app/SampleProject (0x10af736f0).
One of the two will be used. Which one is undefined.

Prior to my update to Firebase SDK v6.26.0 I would only get the first warning, but since the update it crashes.

I saw a doc about how to use Firebase within libraries and a GitHub issue regarding a similar crash. But nothing seems to work to resolve this crash, other then downgrading.

I uploaded a sample project: https://github.com/basvankuijck/SampleProjectFirebaseCrash.

Removing the SwiftPM Promises dependency is not an option, since the actual project is using a SwiftPM dependency that has a dependency to Promises.

The Podfile is nothing that fancy, and the SampleProject just uses one single SwiftPM dependency.

Anyone who has an idea how to let SwiftPM and CocoaPods play nicely together especially with Firebase in the middle?

basvk
  • 4,437
  • 3
  • 29
  • 49

1 Answers1

6

I faced the exact same problem with Firebase and FBLPromise. For me it arose because I added Firebase/FireStore in podfile but the rest of the FIrebase dependencies from SPM. Among my other SPM dependencies was FBLPromise as well.

To fix it I had to remove the FIrebase package from SPM and then add it again with FIrestore and other dependencies that I could need from Firebase.

No other solution worked for me.

sankalp210691
  • 83
  • 1
  • 6