Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error - promise #1041

Closed
ArthurKnoep opened this issue Sep 10, 2018 · 6 comments
Closed

Compile error - promise #1041

ArthurKnoep opened this issue Sep 10, 2018 · 6 comments

Comments

@ArthurKnoep
Copy link

  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

@wynch
Copy link

wynch commented Sep 10, 2018

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)

@FloPMT
Copy link

FloPMT commented Sep 10, 2018

@wynch Thank you that worked.

@ArthurKnoep
Copy link
Author

@wynch Thanks a lot, it works now

@wynch
Copy link

wynch commented Sep 10, 2018

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)

@ArthurKnoep
Copy link
Author

Is this normal ?

@evollu
Copy link
Owner

evollu commented Sep 12, 2018

fixed in 16.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants