When I create an react native app with react-native init and add react-native-fcm with npm, I cannot compile the projet with react-native run-android
Logs:
:react-native-fcm:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/home/arthur/Documents/node/react-native/ReactNotifTest2/node_modules/react-native-fcm/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java:217: error: cannot find symbol
promise.resolve(null);
^
symbol: variable promise
location: class FIRMessagingModule
/home/arthur/Documents/node/react-native/ReactNotifTest2/node_modules/react-native-fcm/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java:220: error: cannot find symbol
promise.reject(null,e.getMessage());
^
symbol: variable promise
location: class FIRMessagingModule
/home/arthur/Documents/node/react-native/ReactNotifTest2/node_modules/react-native-fcm/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java:228: error: cannot find symbol
promise.resolve(null);
^
symbol: variable promise
location: class FIRMessagingModule
/home/arthur/Documents/node/react-native/ReactNotifTest2/node_modules/react-native-fcm/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java:231: error: cannot find symbol
promise.reject(null,e.getMessage());
^
symbol: variable promise
location: class FIRMessagingModule
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 errors
:react-native-fcm:compileReleaseJavaWithJavac FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-fcm:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Step to reproduce:
react-native init {name}npm i --save react-native-fcmreact-native linkreact-native run-androidPs: I'm a newbie to react native and firecloud
This change came from version 16.2.1....
You can fix that by changing your dependency in your package.json : "react-native-fcm" : "16.2.0" (important : remove the ^ to force this exact version)
@wynch Thank you that worked.
@wynch Thanks a lot, it works now
The error comes from this file
the Method public void unsubscribeFromTopic(String topic)(line 225) signature should be public void unsubscribeFromTopic(String topic, Promise promise)
Is this normal ?
fixed in 16.2.2
Most helpful comment
This change came from version 16.2.1....
You can fix that by changing your dependency in your package.json : "react-native-fcm" : "16.2.0" (important : remove the ^ to force this exact version)