firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.67k stars 1.49k forks source link

CRASHLYTICS - Undefined symbol: _OBJC_CLASS_$_JSContext #13995

Closed naticio closed 2 weeks ago

naticio commented 2 weeks ago

Description

it happens when using other linker flags -Objc

Reproducing the issue

it happens when using other linker flags -Objc

Firebase SDK Version

10.28

Xcode Version

15.3

Installation Method

Swift Package Manager

Firebase Product(s)

Crashlytics

Targeted Platforms

iOS

Relevant Log Output

No response

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet
```json Replace this line with the contents of your Package.resolved. ```

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet
```yml Replace this line with the contents of your Podfile.lock! ```
google-oss-bot commented 2 weeks ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

naticio commented 2 weeks ago

ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found Undefined symbols for architecture arm64: "_OBJCCLASS$_JSContext", referenced from: in GoogleMobileAds[arm64]448 ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found

Undefined symbol: _OBJCCLASS$_JSContext

Linker command failed with exit code 1 (use -v to see invocation)

ncooke3 commented 2 weeks ago

The missing symbol comes from the GoogleMobileAds SDK rather than a Firebase SDK.

"_OBJCCLASS$_JSContext", referenced from: in GoogleMobileAds[arm64]448

The JSContext symbol is defined in Apple's JavaScriptCore framework: https://developer.apple.com/documentation/javascriptcore/jscontext?language=objc

I would recommend trying to link the JavaScriptCore by going to your target's build settings > Frameworks, Libraries, and Embedded Content > + > search for JavaScriptCore` > select and add.

Screenshot 2024-10-30 at 9 07 59 AM

For more help with Google Mobile Ads, please file an issue over at https://github.com/googleads/swift-package-manager-google-mobile-ads