:react-native-firebase:compileReleaseJavaWithJavac
/Users/gh.mbp974/Documents/DEV_SITE/quizzApp/appv2/quizz/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/messaging/RNFirebaseMessaging.java:34: error: RNFirebaseMessaging is not abstract and does not override abstract method onActivityResult(int,int,Intent) in ActivityEventListener
public class RNFirebaseMessaging extends ReactContextBaseJavaModule implements LifecycleEventListener, ActivityEventListener {
^
1 error
Incremental compilation of 2 classes completed in 0.402 secs.
:react-native-firebase:compileReleaseJavaWithJavac FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':react-native-firebase: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
Total time: 6.337 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
@Salakar how is this erroring? The abstract method has been there for over a year on RN!
Is this my question? I don't know.
I install this plugins and follow your doc, and after i try react-native run-android and this error
Nope was asking Salakar!
@GH974 On your terminal, could you run react-native -v please and let us know the version of react-native-cli
Cheers
Oh sorry...
react-native-cli: 2.0.1
react-native: 0.47.2
@GH974 Ta, could you navigate to /node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/messaging/RNFirebaseMessaging.java
In there, could you check the onActivityResult exists for sanity please (should be at the bottom).
@Override
public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
// todo hmm?
}
@Override
public void onNewIntent(Intent intent) {
// todo hmm?
Utils.sendEvent(getReactApplicationContext(), "messaging_notification_received", parseIntent(intent));
}
Hi @GH974
Your projects RN version is out-dated, so here's why & how to fix:
Your RN versions ActivityEventListener is looking for the method: onActivityResult(int,int,Intent), which exists on RN versions <0.33:
This was then changed in 0.33 to the current implementation of onActivityResult(Activity activity, int requestCode, int resultCode, Intent data).
I think that your gradle is not correctly looking at node_modules for React Native & is instead looking for React Native from the maven repository which is on v0.20.1 (https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.facebook.react%22) as they stopped publishing to maven in favour of node_modules.
Make sure your android/build.gradle has the following:
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
url "https://maven.google.com"
}
}
}
I have new error
Could not find com.google.firebase:firebase-ads:11.2.0.
Searched in the following locations:
file:/Users/gh.mbp974/Library/Android/sdk/extras/google/m2repository/com/google/firebase/firebase-ads/11.2.0/firebase-ads-11.2.0.pom
file:/Users/gh.mbp974/Library/Android/sdk/extras/google/m2repository/com/google/firebase/firebase-ads/11.2.0/firebase-ads-11.2.0.jar
file:/Users/gh.mbp974/Documents/DEV_SITE/quizzApp/testQuizz/AwesomeProject/android/sdk-manager/com/google/firebase/firebase-ads/11.2.0/firebase-ads-11.2.0
@GH974 from above screenshot:

Yes I added this. thanks its works
Thanks a lot @Ehesp !! It worked like a charm!
Most helpful comment
Hi @GH974
Your projects RN version is out-dated, so here's why & how to fix:
Your RN versions ActivityEventListener is looking for the method:
onActivityResult(int,int,Intent), which exists on RN versions <0.33:https://github.com/facebook/react-native/blob/0.32-stable/ReactAndroid/src/main/java/com/facebook/react/bridge/ActivityEventListener.java
This was then changed in 0.33 to the current implementation of
onActivityResult(Activity activity, int requestCode, int resultCode, Intent data).I think that your gradle is not correctly looking at
node_modulesfor React Native & is instead looking for React Native from the maven repository which is on v0.20.1 (https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.facebook.react%22) as they stopped publishing to maven in favour ofnode_modules.Make sure your
android/build.gradlehas the following: