Open klausbreyer opened 5 years ago
I've seen something like this before. I did following: rm -rf node_modules && npm install
You will see this error if the native module is not compiled and linked correctly. Make sure that you have these lines
include ':react-native-fcm'
and project(':react-native-fcm').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fcm/android')
compile project(':react-native-fcm')
(or implementation ....)import com.evollu.react.fcm.FIRMessagingPackage;
new FIRMessagingPackage()
in the getPackages()
arrayAs well as the necessary google links outlined in https://github.com/evollu/react-native-fcm#android-configuration
If you're using RN with version < 0.6 , you need use jetifier to migrate (Now I am using RN 0.59.8) and I ran following:
npm install --save-dev jetifier
npx jetify
npx react-native run-android (your app should correctly compile and work)
That worked for me as well reference: https://github.com/mikehardy/jetifier#usage-for-source-files
I am working with the example project from this repo. And I have a problem to access FCM.
And this is very weird. Because the console.log clearly shows that the FCM object is there. But then there is this error and execution of the componentDidMount ends.
Android 8.1 Simulator
The same code is working on ios like a charm. Maybe this is linked to my other issue? https://github.com/evollu/react-native-fcm/issues/1026