firebase-ios-sdk: SDK failed to compile, Undefined symbol: _OBJC_CLASS_$_FIRHeartbeatController, Xcode 13.3.1

Environment

  • Xcode version: 13.3.1
  • Firebase SDK version: 9.0.0
  • Installation method: Carthage
  • Firebase Component:
    • FirebaseAnalyticsBinary
    • FirebasePerformanceBinary
    • FirebaseCrashlyticsBinary
  • Target platform(s): iOS

Problem

I was trying to update Firebase from 8.6.0 -> 9.0.0 using command

$ carthage update --platform iOS --use-xcframeworks --no-use-binaries --cache-builds

Then I saw the following compilation error in Xcode log

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

I checked the complied FirebaseCore using nm and it’s the confirmed that _OBJC_CLASS_$_FIRHeartbeatController is undefined

$ jingwang@jings-f8book-pro FirebaseCore.xcframework % nm ./ios-arm64/FirebaseCore.framework/FirebaseCore | grep _OBJC_CLASS_$_FIRHeartbeatController
image

Steps to reproduce:

It is very easy to reproduce this error and here is the sample project. Also, I searched the repo [firebase-ios-sdk](https://github.com/firebase/firebase-ios-sdk) but I could not find that controller.

image

Workaround

Then I rolled back to earlier version 8.9.1 and 8.9.0, the compilation error was gone and the project complied and ran.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Thanks @ivanornes 👍

@InfinityCode777, I’m going to close this as the solution for Carthage was to include the FirebaseCoreInternal.xcframework. I’m happy to re-open if there are further issues. Thanks!

Hi, @ncooke3

The project compiles and runs after I included FirebaseCoreInternal.xcframework in the project. Thanks for the hope and I am sorry for such a late reply.

Jing

Thanks @ivanornes 👍

@InfinityCode777, I’m going to close this as the solution for Carthage was to include the FirebaseCoreInternal.xcframework. I’m happy to re-open if there are further issues. Thanks!

No problem @ncooke3. No, it was there for some reason