React-native-admob: Build fails with latest React Native

Created on 30 Apr 2018  路  18Comments  路  Source: sbugert/react-native-admob

D:\projects\fortunanode_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.

How can i fix this?

Most helpful comment

Hi all, I just delete the @Override annotation in the line 89 of the file RNAdMobRewardedVideoAdModule.java. And now it works :)

All 18 comments

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.

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\testnode_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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lydongray picture lydongray  路  4Comments

booboothefool picture booboothefool  路  3Comments

aligenc picture aligenc  路  3Comments

xvlm picture xvlm  路  5Comments

furkancelik picture furkancelik  路  5Comments