react-native-fcm icon indicating copy to clipboard operation
react-native-fcm copied to clipboard

fatal error: module 'Firebase' not found, not using cocoapods

Open mokingguy opened this issue 6 years ago • 21 comments

I'm running this versions of RN and RNFCM

    "react-native": "0.50.3",
    "react-native-fcm": "^14.1.3",

I'm getting an error on build saying It can't find the Firebase module, I've added the Firebase manually and linked the library manually also.

I've added firebase.h, module.modulemap. Added the user headers, Header and framework search paths, Also I've added the the library to the build phase

I've also read #826 and followed some solutions there and didn't work.

Here are some screenshots that might be useful

screen shot 2018-04-13 at 8 33 14 pm screen shot 2018-04-13 at 8 33 25 pm screen shot 2018-04-13 at 8 33 55 pm screen shot 2018-04-13 at 8 35 21 pm screen shot 2018-04-13 at 8 35 14 pm screen shot 2018-04-13 at 8 35 08 pm

screen shot 2018-04-13 at 8 39 28 pm

mokingguy avatar Apr 14 '18 01:04 mokingguy

Having the same issue :(

yarikgenza avatar Apr 15 '18 08:04 yarikgenza

are you installing Firebase SDK manually or through cocapod?

evollu avatar Apr 15 '18 22:04 evollu

Manually, for some reason installed an ancient version of react when I ran pods, even though React is not on the podfile.

On Sun, Apr 15, 2018, 5:56 PM Libin Lu [email protected] wrote:

are you installing Firebase SDK manually or through cocapod?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/evollu/react-native-fcm/issues/896#issuecomment-381444849, or mute the thread https://github.com/notifications/unsubscribe-auth/AIE8gUV-V3MN7XoqoZuJ_lk7x-_2yScYks5to9AtgaJpZM4TU4UE .

mokingguy avatar Apr 15 '18 22:04 mokingguy

ok have you compared with example under the no pod example?

evollu avatar Apr 15 '18 23:04 evollu

I have, every thing seems to be the same, I followed the no-pod instructions to the letter, downloaded the sdk, imported the frameworks, added the map and firebase.h, added the library project, as per react-native instructions and everything.

There's something that I've might missed, that could explain this?.

On Sun, Apr 15, 2018, 6:01 PM Libin Lu [email protected] wrote:

ok have you compared with example under the no pod example https://github.com/evollu/react-native-fcm/tree/no-pod/Examples/simple-fcm-client ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/evollu/react-native-fcm/issues/896#issuecomment-381445163, or mute the thread https://github.com/notifications/unsubscribe-auth/AIE8gWmUSuoTOOG0tyQ_scDqst1ADVMMks5to9FYgaJpZM4TU4UE .

mokingguy avatar Apr 15 '18 23:04 mokingguy

can you provide a public repo with the issue so I can take a look

evollu avatar Apr 15 '18 23:04 evollu

Following, having the same issue

wincod75 avatar Apr 16 '18 03:04 wincod75

I'd rather not share publicly the whole repo, is it possible the I could only share the ios project?

mokingguy avatar Apr 16 '18 14:04 mokingguy

My default import in RNFIRMessaging.h was:

#if __has_include(<Firebase.h>) #import <FirebaseCore/FirebaseCore.h> #import <FirebaseMessaging/FirebaseMessaging.h> #import <FirebaseInstanceID/FirebaseInstanceID.h> #else @import Firebase; #endif

I modified it to:

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

Now it seems to be working fine.

404sand808s avatar Apr 16 '18 15:04 404sand808s

I did the same, I've tried all the variations suggested on #826 and none seemed to work

mokingguy avatar Apr 16 '18 15:04 mokingguy

@mokingguy you can just create a new empty project with the issue.

evollu avatar Apr 19 '18 12:04 evollu

I was getting same problem. In my case issue was, I added group name Firebase inside project. Firebase includes Firebase.h + module.modulemap + .frameworks. I got same error and to fix, I modified RNFIRMessaging.xcodeproj search paths to points to Firebase (by default it says framework). This was local fix and not going to work when you get package again. So I renamed Firebase to Frameworks and it works without any changes to RNFIRMessaging.xcodeproj

inderpalaulakh avatar Apr 22 '18 03:04 inderpalaulakh

I am using react-native-fcm": 14.1.4 and also getting this module 'Firebase' not found error. Feels like I have done everything and I have no idea what to do next.

karlmosenbacher avatar Apr 27 '18 20:04 karlmosenbacher

@karlmosenbacher This is not an answer, but I ended up using RNFB plugin over fcm because I could not find a solution to this issue.

wincod75 avatar Apr 28 '18 01:04 wincod75

@wincod75 I guess I could try using it. Thanks!

karlmosenbacher avatar Apr 28 '18 05:04 karlmosenbacher

Last version I can use successfully is 12.0.0. Looking at the commit history on RNFIRMessaging.h, it looks like the import changed quite frequently over the various releases but I can't find any that works for me when not using CocoaPods.

guillaumelachaud avatar May 31 '18 21:05 guillaumelachaud

Nevermind it actually works for me on 15.0.2, out-of-the-box, with Firebase SDK 5.1.0 and no CocoaPods. Make sure you have the frameworks in ios/Frameworks, make sure they are added inside of Xcode and that they have the right Target Membership. Also make sure Firebase.h and module.modulemap are in the same folder and also added to Xcode. It should then work without any sort of modification to RNFIRMessaging.h or RNFIRMessaging.xcodeproj.

guillaumelachaud avatar May 31 '18 21:05 guillaumelachaud

What worked for me was adding ".../ios" directory to the user header search paths. Apparently what happens when you drag and drop into the Frameworks in xcode is that it is added to ".../ios", not ".../ios/Frameworks". It's a bit confusing, but makes sense-- so either create the directory or add to user header paths.

sschiang avatar Dec 06 '18 22:12 sschiang

same, but I use version 16

edritech93 avatar Mar 12 '19 04:03 edritech93

Please help

edritech93 avatar Mar 12 '19 04:03 edritech93

Bump

dashko avatar Apr 19 '20 12:04 dashko