objective-cfirebasefirebase-analyticsxcode12swift-package-manager

Undefined symbol: _OBJC_CLASS_$_FIRApp


I m trying to add Firebase Analytic and Firebase Crashlytics using Swift package manager here is a link of git for firebase SDK
https://github.com/firebase/firebase-ios-sdk

after that I add this two line in my AppDelegate file

#import <FirebaseCore/FIRApp.h>

#import <Firebase.h>

All fine until when I add this [FIRApp configure]; getting error

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

I go thought every link of stack-overflow for similar problem try every solution but nothing help me like change Other Linker Flag etc... Please help me..I really appreciate...I m using Xcode 12.1 with Objective-C here is a screenshot of error which i m getting

enter image description here

And screenshot of added dependency

enter image description here


Solution

  • After so much searched I solved issue. Solution is

    1. "$(inherited)" In Other Linker Flags
    2. Build Active Architecture Only value to "Yes"
    3. Add Run Script for firebase SPM is "${BUILD_DIR%Build/*}SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run"
    4. Clean project
    5. Build Project