react-native-admob
react-native-admob copied to clipboard
Build fails with latest React Native
D:\projects\fortuna\node_modules\react-native-admob\android\src\main\java\com\sbugert\rnadmob\RNAdMobRewardedVideoAdModule.java:89: error: method does not override or implement a method from a supertype @Override ^ 1 error :react-native-admob:compileReleaseJavaWithJavac FAILED
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':react-native-admob:compileReleaseJavaWithJavac'.
How can i fix this?
same issue with 2.0.0-beta.5
Same thing. Anybody knows how to fix it?
I am struggling with this one too. Working on Mac Sierra and failed to run on android emulator :(
I think it's time when plugin author appears :))
Hi all, I just delete the @Override annotation in the line 89 of the file RNAdMobRewardedVideoAdModule.java. And now it works :)
Thanks, @khuongdv, this solved the compilation error. The next issue I'm having now is this one: https://github.com/sbugert/react-native-admob/issues/231, using [email protected].
Have you experienced this as well? Which version of react-native are you using?
@khuongdv would you mind making a PR with your solution?
I think this has to do with not using the latest version of the Google Mobile Ads SDK. Could you try to update the com.google.android.gms:play-services-ads dependency?
removing the @Override works for me. I created a PR with the change.
I was having error
/Users/gyanu/Documents/react native/svs-react/node_modules/react-native-admob/android/src/main/java/com/sbugert/rnadmob/RNAdMobRewardedVideoAdModule.java:20: error: RNAdMobRewardedVideoAdModule is not abstract and does not override abstract method onRewardedVideoCompleted() in RewardedVideoAdListener public class RNAdMobRewardedVideoAdModule extends ReactContextBaseJavaModule implements RewardedVideoAdListener { ^ 1 error
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':react-native-admob:compileDebugJavaWithJavac'.
Solved by adding
@Override
public void onRewardedVideoCompleted() {
sendEvent(EVENT_VIDEO_COMPLETED, null);
}
having the same problem :( unable to find the @override on line 89 in file RNAdMobRewardedVideoAdModule.java
Hi all, I just delete the @override annotation in the line 89 of the file RNAdMobRewardedVideoAdModule.java. And now it works :)
unable to find annotation on line 89 :(
Hi all, I just delete the @override annotation in the line 89 of the file RNAdMobRewardedVideoAdModule.java. And now it works :)
unable to find annotation on line 89 :(
You will need to add it manually
@Override
public void onRewardedVideoCompleted() {
sendEvent(EVENT_VIDEO_COMPLETED, null);
}
getting this error then What went wrong: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
this helped me https://stackoverflow.com/a/50557355/9302583 Resolved
But it broke the entire proj. app is crashing on load
replace plugin build.gradle file with this code
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.facebook.react:react-native:+'
implementation 'com.google.android.gms:play-services-ads:16.0.0'
}
am using this version "react-native-admob": "^1.3.2", i was getting the same problem...
but after adding this - in ReactNative\test\node_modules\react-native-admob\android\src\main\java\com\sbugert\rnadmob\RNAdMobRewardedVideoAdModule.java
after this :-
@Override
public void onRewardedVideoAdLeftApplication() {
sendEvent("rewardedVideoWillLeaveApplication", null);
}
add this:-
@Override
public void onRewardedVideoCompleted() {
sendEvent("rewardedVideoDidCompleted", null);
}
Not an answer but an easy work around while finding a fix just set android.enableJetifier=false in the gradle.property
replace plugin build.gradle file with this code
apply plugin: 'com.android.library' android { compileSdkVersion 28 buildToolsVersion "28.0.3" defaultConfig { minSdkVersion 16 targetSdkVersion 28 } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { implementation 'com.facebook.react:react-native:+' implementation 'com.google.android.gms:play-services-ads:16.0.0' }
Not replaced exactly but updated the version as same to one in my project's build.gradle for this com.google.android.gms:play-services-ads. Thanks though! @SergiOnGit
Hi all, I just delete the @override annotation in the line 89 of the file RNAdMobRewardedVideoAdModule.java. And now it works :)
what is there in line no 89, can you please provide the code of that line?