React-native-fcm: Undefined symbols for architecture armv7:

Created on 30 Jun 2016  路  15Comments  路  Source: evollu/react-native-fcm

After implementing the readme the build directly on a device fails with these errors:

Undefined symbols for architecture armv7: "_OBJC_CLASS_$_FIRApp", referenced from: objc-class-ref in AppDelegate.o "_OBJC_CLASS_$_FIRInstanceID", referenced from: objc-class-ref in libRNFIRMessaging.a(RNFIRMesssaging.o) "_OBJC_CLASS_$_FIRMessaging", referenced from: objc-class-ref in libRNFIRMessaging.a(RNFIRMesssaging.o) "_kFIRInstanceIDTokenRefreshNotification", referenced from: -[RNFIRMessaging setBridge:] in libRNFIRMessaging.a(RNFIRMesssaging.o) ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

also these warnings:
ld: warning: object file (/PATH-byxbzdyvvunexgaoyfngwacuplnc/Build/Products/Debug-iphoneos/libPods-Starmind.a(Pods-App-dummy.o)) was built for newer iOS version (9.0) than being linked (7.0) ld: warning: Auto-Linking supplied '/PATH/App/ios/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/FirebaseInstanceID', framework linker option at /PATH/App/ios/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/FirebaseInstanceID is not a dylib

Any hints what I might be doing wrong? Thanks!

Most helpful comment

Posting here if someone else ends up with the same error.

I had the same issue when using CocoaPods and it occurs directly after pod install without adding anything to AppDelegate.m. Tried with RN: 0.30, 0.28 and CocoaPods: 1.0.1 with fresh projects.

Did not manage to work around it, but using the non-cocoapods approach and adding Firebase manually worked perfect.

Running

  • xcode - 7.3.1
  • rn - 0.28

All 15 comments

Try to update xcode

I have Version 7.3.1.. update to 8-beta?

Seems to be the same issue as #26 .. but also no solution there

I have the same version and it's working fine, but when I had that problem after updating Xcode everything was fine.
Try cleaning your project cache Product => Clean maybe that will help

Thanks but still no luck... if I compile in the simulator I get this error: (maybe it tells you more... I'm still quite new to the react-native game)

The following commands produced analyzer issues:
Analyze Modules/RCTUIManager.m
(1 command with analyzer issues)

The following build commands failed:
Ld build/Build/Products/Debug-iphonesimulator/App.app/App normal x86_64
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/App.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
/PATH/App/node_modules/promise/lib/done.js:10
throw err;
^

screen shot 2016-06-30 at 11 41 46 am
screen shot 2016-06-30 at 11 42 16 am

From the error I think that it's missing Bundle Identifier

(unfortunately) the bundle identifier is correctly set..

After having a second look at the readme.. You don't mention to import: "RNFIRMessaging.h"... Should this be added in the linking of react-native-fcm? is there a step I'm missing out? Or is just the comment "add this line" missing in the readme ?

And yes: I still got the CFBundleIdentifier error... sadly

additionally: started a clean project but still no luck

can't seem to figure it out... bummer - android works perfectly well but ios crashes... gotta find something which works

I'm left with these:
'Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_FIRApp", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_FIRMessaging", referenced from:
objc-class-ref in libRNFIRMessaging.a(RNFIRMesssaging.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)'

@evollu can you check if this error is related to this change https://github.com/facebook/react-native/commit/34ec6a91a9fd85ceb71c4dde884cdc105fd6d7d4 ?

@gorangajic I'm running on 0.28 RN and don't have any issue

@derdav3 yes you need to import "RNFIRMessaging.h" in AppDelegate.m

@derdav3 can I close this?

Posting here if someone else ends up with the same error.

I had the same issue when using CocoaPods and it occurs directly after pod install without adding anything to AppDelegate.m. Tried with RN: 0.30, 0.28 and CocoaPods: 1.0.1 with fresh projects.

Did not manage to work around it, but using the non-cocoapods approach and adding Firebase manually worked perfect.

Running

  • xcode - 7.3.1
  • rn - 0.28
Was this page helpful?
0 / 5 - 0 ratings