invertase / react-native-firebase

🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.71k stars 2.22k forks source link

[🐛] Bug Report React Native Firebase Messaging with Image No building for xCode 12 #5201

Closed devWaleed closed 3 years ago

devWaleed commented 3 years ago

Issue

(:fire:)

I have a project in which I am using react-native-firebase version "@react-native-firebase/app": "^11.3.2" and "@react-native-firebase/messaging": "^11.3.2".

I have followed this documentation here for showing Image in notifications: https://rnfirebase.io/messaging/ios-notification-images

After I completed all the steps, I am trying to run the project but I am getting errors shown below. Note that If I exclude ImageNotifications target from my project Podfile, I am able to build project successfully.

Ld /Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos/ImageNotification.appex/ImageNotification normal (in target 'ImageNotification' from project 'MyApp')
    cd /Users/mac/Desktop/Integrity/ios
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target arm64-apple-ios14.4 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk -L/Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos -L/Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos/DoubleConversion -L/Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos/FirebaseCore -L/Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos/FirebaseCoreDiagnostics -L/Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos/FirebaseInstallations -L/Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos/FirebaseInstanceID -L/Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos/FirebaseMessaging -L/Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos/Folly -L/Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos/GoogleDataTransport -L/Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos/GoogleUtilities-54e75ca4 -L/Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos/PromisesObjC -L/Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos/React-Core-Default-RCTTextHeaders -L/Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos/React-RCTText -L/Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos/React-cxxreact -L/Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos/React-jsi -L/Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos/React-jsiexecutor -L/Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos/React-jsinspector -L/Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos/Yoga -L/Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos/glog -L/Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos/nanopb -F/Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos -filelist /Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Intermediates.noindex/MyApp.build/Debug-iphoneos/ImageNotification.build/Objects-normal/arm64/ImageNotification.LinkFileList -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/../../Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Intermediates.noindex/MyApp.build/Debug-iphoneos/ImageNotification.build/Objects-normal/arm64/ImageNotification_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fembed-bitcode-marker -fobjc-arc -fobjc-link-runtime -fapplication-extension -ObjC -lDoubleConversion -lFirebaseCore -lFirebaseCoreDiagnostics -lFirebaseInstallations -lFirebaseInstanceID -lFirebaseMessaging -lFolly -lGoogleDataTransport -lGoogleUtilities-54e75ca4 -lPromisesObjC -lReact-Core-Default-RCTTextHeaders -lReact-RCTText -lReact-cxxreact -lReact-jsi -lReact-jsiexecutor -lReact-jsinspector -lYoga -lglog -lnanopb -lsqlite3 -lstdc++ -lz -framework CoreTelephony -framework Foundation -framework JavaScriptCore -framework Security -framework SystemConfiguration -framework UIKit -weak_framework UserNotifications -e _NSExtensionMain -lPods-ImageNotification -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Intermediates.noindex/MyApp.build/Debug-iphoneos/ImageNotification.build/Objects-normal/arm64/ImageNotification_dependency_info.dat -o /Users/mac/Library/Developer/Xcode/DerivedData/MyApp-gviubszdpkdtxvgtnxdfkshxwlgk/Build/Products/Debug-iphoneos/ImageNotification.appex/ImageNotification

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_RCTInspectorDevServerHelper", referenced from:
      objc-class-ref in libReact-Core-Default-RCTTextHeaders.a(RCTBridge.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Project Files

Javascript

#### `package.json`: ``` { "name": "MyApp", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "@react-native-community/masked-view": "^0.1.10", "@react-native-community/push-notification-ios": "^1.8.0", "@react-native-firebase/analytics": "^11.3.2", "@react-native-firebase/app": "^11.3.2", "@react-native-firebase/crashlytics": "^11.3.2", "@react-native-firebase/in-app-messaging": "^11.3.2", "@react-native-firebase/messaging": "^11.3.2", "@react-native-firebase/remote-config": "^11.3.2", "@react-navigation/drawer": "^5.12.5", "@react-navigation/native": "^5.9.2", "@react-navigation/stack": "^5.14.2", "axios": "^0.21.1", "build-url": "^6.0.1", "creditcardutils": "^1.0.0", "react": "16.13.1", "react-native": "0.63.4", "react-native-app-intro-slider": "^4.0.4", "react-native-device-info": "^8.0.6", "react-native-drawer": "https://github.com/devWaleed/react-native-drawer#25f74a8ba49e3f75fbf609250fafa2af8e9f9d04", "react-native-fast-image": "^8.3.4", "react-native-gesture-handler": "^1.9.0", "react-native-inappbrowser-reborn": "^3.5.1", "react-native-linear-gradient": "^2.5.6", "react-native-modalize": "^2.0.8", "react-native-pager-view": "^5.1.3", "react-native-push-notification": "^7.2.2", "react-native-reanimated": "^1.13.2", "react-native-safe-area-context": "^3.1.9", "react-native-screens": "^2.17.1", "react-native-skeleton-placeholder": "^3.0.4", "react-native-snap-carousel": "^3.9.1", "react-native-splash-screen": "^3.2.0", "react-native-tab-view": "^3.0.1", "react-native-text-input-mask": "^3.1.4", "react-native-webview": "^11.3.2", "react-redux": "^7.2.2", "redux": "^4.0.5", "redux-saga": "^1.1.3", "sp-react-native-in-app-updates": "^0.1.2", "tipsi-stripe": "^8.0.2" }, "devDependencies": { "@babel/core": "^7.13.10", "@babel/runtime": "^7.13.10", "@react-native-community/eslint-config": "^2.0.0", "babel-jest": "^26.6.3", "eslint": "^7.21.0", "jest": "^26.6.3", "metro-react-native-babel-preset": "^0.65.2", "react-test-renderer": "16.13.1" }, "jest": { "preset": "react-native" } } ``` #### `firebase.json` for react-native-firebase v6: ``` Default whatever comes with the project after installing this package. ```

iOS

Click To Expand

#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like: ``` require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' platform :ios, '10.0' target 'MyApp' do config = use_native_modules! use_react_native!(:path => config["reactNativePath"]) target 'MyAppTests' do inherit! :complete # Pods for testing end # Enables Flipper. # # Note that if you have use_frameworks! enabled, Flipper will not work and # you should disable these next few lines. use_flipper!({ 'Flipper' => '0.74.0' }) post_install do |installer| flipper_post_install(installer) end end target 'MyApp-tvOS' do # Pods for MyApp-tvOS target 'MyApp-tvOSTests' do inherit! :search_paths # Pods for testing end end target 'ImageNotification' do pod 'Firebase/Messaging', '7.10.0' # eg 6.31.0 end pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text', :modular_headers => true ``` #### `AppDelegate.m`: ```objc // N/A ```


Android

Click To Expand

#### Have you converted to AndroidX? - [ ] my application is an AndroidX application? - [ ] I am using `android/gradle.settings` `jetifier=true` for Android compatibility? - [ ] I am using the NPM package `jetifier` for react-native compatibility? #### `android/build.gradle`: ```groovy // N/A ``` #### `android/app/build.gradle`: ```groovy // N/A ``` #### `android/settings.gradle`: ```groovy // N/A ``` #### `MainApplication.java`: ```java // N/A ``` #### `AndroidManifest.xml`: ```xml ```


Environment

Click To Expand

**`react-native info` output:** ``` OUTPUT GOES HERE ``` - **Platform that you're experiencing the issue on**: - [x] iOS - [ ] Android - [ ] **iOS** but have not tested behavior on Android - [ ] **Android** but have not tested behavior on iOS - [ ] Both - **`react-native-firebase` version you're using that has this issue:** 11.3.2 - **`Firebase` module(s) you're using that has the issue:** Messaging with Image - **Are you using `TypeScript`?** No

mikehardy commented 3 years ago

Hi there!


Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_RCTInspectorDevServerHelper", referenced from:
      objc-class-ref in libReact-Core-Default-RCTTextHeaders.a(RCTBridge.o)
ld: symbol(s) not found for architecture arm64

This does not appear to reference anything in react-native-firebase

The extension was contributed by the community and is a fairly advanced trick - in order to use it you'll need to be comfortable figuring out what symbols are necessary and how to make sure they are linked into the extension