react-native-fcm: Linker command failed with exit code 1

Versions RN 0.44 react-native-fcm 6.2.3 What device are you using? iOS 10

Problem When I build the project after linking manually without cocoapods I got Linker command failed with exit code 1 . I can inspect the report navigator and then I can see an extra warning 1 duplicate symbol for architecture x86_64 so as I have react-native-firebase library also linked in my project I think that there may be some conflicts. Any clue?

About this issue

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

Most upvoted comments

if you are using latest fcm repo, you need V4.0.0 SDK for IOS

have same error while build. this is detailed info:

Building RNFIRMessaging/RNFIRMessaging [Release]
▸ Check Dependencies

❌  /Users/administrator/applicationName/app/node_modules/react-native-fcm/ios/RNFIRMessaging.m:195:11: use of undeclared identifier 'FIRMessagingConnectionStateChangedNotification'

name:FIRMessagingConnectionStateChangedNotification object:nil];
                                                                                     ^



❌  /Users/administrator/applicationName/app/node_modules/react-native-fcm/ios/RNFIRMessaging.m:199:35: no visible @interface for 'FIRMessaging' declares the selector 'setDelegate:'

[[FIRMessaging messaging] setDelegate:self];
          ^



❌  /Users/administrator/applicationName/app/node_modules/react-native-fcm/ios/RNFIRMessaging.m:206:31: no visible @interface for 'FIRMessaging' declares the selector 'setShouldEstablishDirectChannel:'

[[FIRMessaging messaging] setShouldEstablishDirectChannel:@YES];
         ~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~



❌  /Users/administrator/applicationName/app/node_modules/react-native-fcm/ios/RNFIRMessaging.m:211:39: no visible @interface for 'FIRMessaging' declares the selector 'isDirectChannelEstablished'

resolve([[FIRMessaging messaging] isDirectChannelEstablished] ? @YES: @NO);
     ~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



❌  /Users/administrator/applicationName/app/node_modules/react-native-fcm/ios/RNFIRMessaging.m:226:38: property 'APNSToken' not found on object of type 'FIRMessaging *'

resolve([FIRMessaging messaging].APNSToken);
             ~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~



❌  /Users/administrator/applicationName/app/node_modules/react-native-fcm/ios/RNFIRMessaging.m:231:38: property 'FCMToken' not found on object of type 'FIRMessaging *'

resolve([FIRMessaging messaging].FCMToken);
                                     ^



❌  /Users/administrator/applicationName/app/node_modules/react-native-fcm/ios/RNFIRMessaging.m:479:93: property 'isDirectChannelEstablished' not found on object of type 'FIRMessaging *'

[self sendEventWithName:FCMDirectChannelConnectionChanged body:[FIRMessaging messaging].isDirectChannelEstablished ? @YES: @NO];
                                     ^



❌  /Users/administrator/applicationName/app/node_modules/react-native-fcm/ios/RNFIRMessaging.m:480:67: property 'isDirectChannelEstablished' not found on object of type 'FIRMessaging *'

NSLog(@"connectionStateChanged: %@", [FIRMessaging messaging].isDirectChannelEstablished ? @"connected": @"disconnected");
                                                                                            ^



❌  /Users/administrator/applicationName/app/node_modules/react-native-fcm/ios/RNFIRMessaging.m:195:11: use of undeclared identifier 'FIRMessagingConnectionStateChangedNotification'

name:FIRMessagingConnectionStateChangedNotification object:nil];
                                                                  ^



❌  /Users/administrator/applicationName/app/node_modules/react-native-fcm/ios/RNFIRMessaging.m:199:35: no visible @interface for 'FIRMessaging' declares the selector 'setDelegate:'

[[FIRMessaging messaging] setDelegate:self];
          ^



❌  /Users/administrator/applicationName/app/node_modules/react-native-fcm/ios/RNFIRMessaging.m:206:31: no visible @interface for 'FIRMessaging' declares the selector 'setShouldEstablishDirectChannel:'

[[FIRMessaging messaging] setShouldEstablishDirectChannel:@YES];
         ~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~



❌  /Users/administrator/applicationName/app/node_modules/react-native-fcm/ios/RNFIRMessaging.m:211:39: no visible @interface for 'FIRMessaging' declares the selector 'isDirectChannelEstablished'

resolve([[FIRMessaging messaging] isDirectChannelEstablished] ? @YES: @NO);
     ~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



❌  /Users/administrator/applicationName/app/node_modules/react-native-fcm/ios/RNFIRMessaging.m:226:38: property 'APNSToken' not found on object of type 'FIRMessaging *'

resolve([FIRMessaging messaging].APNSToken);
             ~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~



❌  /Users/administrator/applicationName/app/node_modules/react-native-fcm/ios/RNFIRMessaging.m:231:38: property 'FCMToken' not found on object of type 'FIRMessaging *'

resolve([FIRMessaging messaging].FCMToken);
                                     ^



❌  /Users/administrator/applicationName/app/node_modules/react-native-fcm/ios/RNFIRMessaging.m:479:93: property 'isDirectChannelEstablished' not found on object of type 'FIRMessaging *'

[self sendEventWithName:FCMDirectChannelConnectionChanged body:[FIRMessaging messaging].isDirectChannelEstablished ? @YES: @NO];
                                     ^



❌  /Users/administrator/applicationName/app/node_modules/react-native-fcm/ios/RNFIRMessaging.m:480:67: property 'isDirectChannelEstablished' not found on object of type 'FIRMessaging *'

NSLog(@"connectionStateChanged: %@", [FIRMessaging messaging].isDirectChannelEstablished ? @"connected": @"disconnected");
                                                                                            ^


** ARCHIVE FAILED **

For those using CocoaPods, the problem was solved using a fixed version of Firebase in the Podfile

pod 'Firebase/Core', '4.0.0'

pod update was downgrading to a previous version of the Firebase pods.

In my case i had to use the non cocoa approach, but the SDK available to download on firebase doc is v3, https://firebase.google.com/docs/ios/setup#frameworks.

I created another clone of my own project, initialized pod on it then i put these lines

  pod 'Firebase/Core', '4.0.0'
  pod 'Firebase/Messaging'

in myPodfile and ran pod install. So i imported the SDK from the Pod folder to my project on XCode

And it has worked for me.

These are my dependencies:

"react": "16.0.0-alpha.12",
"react-native": "0.45.1",
"react-native-fcm": "^7.5.1"

Ok, I got it to build by adding in Build Settings > Framework Search Paths > + > $(inherited) for a second time. Don’t know why that didn’t work the first, but XCode is still a maze to me.

Shouldn’t this be in the docs?