Darshan
Darshan

Reputation: 2379

Undefined symbol: _OBJC_CLASS_$_FIRAnalytics

I am trying to Call Firebase Analytics in my iOS app ,i am getting error while compiling project .

I have created one framework and from that framework calling firebase analytics but I don’t understand getting below error.

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_FIRAnalytics", referenced from:
      objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Showing Recent Errors Only
:-1: Undefined symbol: _OBJC_CLASS_$_FIRAnalytics

Below is my app structure

Upvotes: 4

Views: 11485

Answers (3)

Homam
Homam

Reputation: 63

In my case this was solved by updating the 'tag' in the following line in ios/Podfile to the most recent tag (based on the github repository):

pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '10.1.0'

Upvotes: 0

M3nd3z
M3nd3z

Reputation: 316

Please make sure you import the PromisesObjc.framework after deleting your old Firebase libraries. I tried all the other steps but this one was also required.

Upvotes: 1

ViktoR
ViktoR

Reputation: 761

I had a similar issue when added Firebase using Carthage.

So after running a command carthage update --platform iOS you need to copy files from Carthage/Build/iOS/ into your project Actually it just copied references to Firebase files, but files were still in Carthage/Build/iOS/ folder

After updating of Xcode and therefore Swift - I needed to update my dependencies - and after that, I got such an error

The reason was that after update an additional PromisesObjC.framework was introduced, and it, of course, was not included in the project.

So the complete removal of all Firebase-related frameworks and adding them again - fixed the problem.

P.S. and don't forget to delete Firebase.framework from the Link Binary With Libraries Build Phase in Xcode not to run in another error after update :) Error: Firebase.framework does not contain bitcode.

Upvotes: 5

Related Questions