React-native-fcm: Compile error - promise

Created on 10 Sep 2018  路  6Comments  路  Source: evollu/react-native-fcm

  1. What version of RN and react-native-fcm are you running?
    RN: 0.56.0 / React-Native-FCM: 16.2.1
  2. What device are you using? (e.g iOS9 emulator, Android 6 device)?
    Android 8.0 device
  3. Is your app running in foreground, background or not running?
    Not compiling

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-fcm
  • react-native link
  • react-native run-android

Ps: I'm a newbie to react native and firecloud

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)

All 6 comments

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

https://github.com/evollu/react-native-fcm/blob/master/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java

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

Was this page helpful?
0 / 5 - 0 ratings