evollu / react-native-fcm

react native module for firebase cloud messaging and local notification
MIT License
1.73k stars 681 forks source link

Execution failed for task ':react-native-fcm:compileDebugJavaWithJavac'. #1113

Open yusuf987 opened 5 years ago

yusuf987 commented 5 years ago

project info "react-native": "0.49.3", "react-native-fcm": "16.2.0",

till yesterday there was no issue with my project, but today I am not able to build the project even I did not change a single line I am getting below error

> Task :react-native-fcm:compileDebugJavaWithJavac
D:\K_E\KE_7_may\koenig-employee\node_modules\react-native-fcm\android\src\main\java\com\evollu\react\fcm\InstanceIdService.java:14: error: cannot find symbol
import com.google.firebase.iid.FirebaseInstanceIdService;
                              ^
  symbol:   class FirebaseInstanceIdService
  location: package com.google.firebase.iid
D:\K_E\KE_7_may\koenig-employee\node_modules\react-native-fcm\android\src\main\java\com\evollu\react\fcm\InstanceIdService.java:16: error: cannot find symbol
public class InstanceIdService extends FirebaseInstanceIdService {
                                       ^
  symbol: class FirebaseInstanceIdService
D:\K_E\KE_7_may\koenig-employee\node_modules\react-native-fcm\android\src\main\java\com\evollu\react\fcm\InstanceIdService.java:26: error: method does not override or implement a method from a supertype
    @Override
    ^
D:\K_E\KE_7_may\koenig-employee\node_modules\react-native-fcm\android\src\main\java\com\evollu\react\fcm\InstanceIdService.java:44: error: cannot find symbol
                ReactInstanceManager mReactInstanceManager = ((ReactApplication) getApplication()).getReactNativeHost().getReactInstanceManager();
                                                                                 ^
  symbol: method getApplication()
D:\K_E\KE_7_may\koenig-employee\node_modules\react-native-fcm\android\src\main\java\com\evollu\react\fcm\InstanceIdService.java:48: error: cannot find symbol
                    LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(message);
                                                      ^
  symbol: method getApplicationContext()
D:\K_E\KE_7_may\koenig-employee\node_modules\react-native-fcm\android\src\main\java\com\evollu\react\fcm\InstanceIdService.java:53: error: cannot find symbol
                            LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(message);
                                                              ^
  symbol: method getApplicationContext()
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
6 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-fcm:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

can somebody please help me to solve and understand why this happens

Thanks

Bob-JZhao commented 5 years ago

@yusuf987 you could find a solution at here https://github.com/evollu/react-native-fcm/issues/1111

yusuf987 commented 5 years ago

thanks, @YourBoB , I found the solution here #1111

Fcasasherrera commented 5 years ago

This worked for me

change firebase version in below files: ${project}\node_modules\react-native-fcm\android\build.gradle,

... //def DEFAULT_FIREBASE_CORE_VERSION = "+" //def DEFAULT_FIREBASE_MESSAGING_VERSION = "+" def DEFAULT_FIREBASE_CORE_VERSION = "16.0.3" def DEFAULT_FIREBASE_MESSAGING_VERSION = "17.6.0" ...

hidayatridwan commented 5 years ago

Thanks @YourBoB i resolve with this link

berksafran commented 3 years ago

Solution is here: https://github.com/evollu/react-native-fcm/issues/1111#issuecomment-839223648