react-native-fcm: Module 'FirebaseCore' not found when building project

I have recently upgraded an app from 2.2.0 to 2.5.1 and I have stumbled upon the following error when building RNFIRMessaging.m: Module 'FirebaseCore' not found when trying to @import FirebaseCore;.

Oddly enough, if I replace that line with @import Firebase; the build succeeds and the push notifications work. I could also reproduce this issue on a newly created RN application.

I have tested this on React Native 0.39.1, the version of the package is 2.5.1 and I am using CocoaPods 1.1.1. Tested on an iPad Mini.

Have I missed some configuration step, or is this a known issue?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 5
  • Comments: 18 (3 by maintainers)

Most upvoted comments

@ramilushev I finally got this to work by replacing the 3 lines in the file with these:

#import <FirebaseCore/FirebaseCore.h>
//import FirebaseCore;
#import <FirebaseMessaging/FirebaseMessaging.h>
//import FirebaseMessaging;
//import FirebaseInstanceID;
#import <FirebaseInstanceID/FirebaseInstanceID.h>

Not really sure what significance this has, but at least my project builds now.

U need to download the latest firebase sdk, or run an update/upgrade on cocoapods

Screenshot 2022-07-15 at 6 08 36 PM in my case i added : use_frameworks! :linkage => :static

and commented : use_flipper!()

as shown in images

I did pod update and pod redo update but I am unable to get rid of that error.

Upgrade firebase native code