Search code examples
iosobjective-cxcodefirebasecocoapods

ld: framework not found FirebaseAnalytics after upgrading from 4.x.x to 5.x.x firebase through cocoapods


Xcode starts encountering this error

ld: framework not found Firebase-XXXXXX

where XXXXXX would be any framework listed in the podfile, here is the specific part of that podfile

pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'FirebaseUI/Database'
pod 'Firebase/Storage'
pod 'Firebase/Messaging'

after I update the existing project's firebase frameworks (which were in 4.x.x version at the time of starting this project) to the newer 5.x.x version of firebase (for using ML-Kit) using pod install in the project directory, it fails to compile it.

Steps taken so far after going through the web,

The following is done with a backed copy of running 4.x.x version of project,

a) Tried all answers from this green ticked question

b) Cleared Xcode's Derived data for this project, cocoapods cache uninstalled/ reinstalling it entirely. Commented out firebase part in podfile and then pod install it twice (one for removing the firebase and second for installing it again)

c) Manually copying the error generating firebase dependancies to the project's folder (bad idea, 52 bugs 300+ warnings)

Help will be highly appreciated.


Solution

  • Every Firebase dependancies has various linkages between them, even if your project doesn't need, For instance -- for this dependency: ld: framework not found FirebaseDatabaseUI was not required in the project and was taken out by these steps,

    Goto

    Target(project_name)-> Build Settings-> search(Other linker flags)-> from their remove the conflicting dependency

    Be sure to build back and check if that dependency was even been used or not, in my case it wasn't.