react-native-admob icon indicating copy to clipboard operation
react-native-admob copied to clipboard

Task :react-native-admob:compileReleaseJavaWithJavac FAILED

Open mxvsh opened this issue 6 years ago • 6 comments

image

I've tried changing these

compileSdkVersion 27
buildToolsVersion "27.0.3"

I've installed the module using npm i -S react-native-admob@next

mxvsh avatar Sep 13 '19 15:09 mxvsh

If you are using androidx than try going to node_modules/react-native-admob , find the files from where you are getting the error and replace import android.support.annotation.Nullable; with import androidx.annotation.Nullable;

I hope this helps.

vlerants avatar Oct 07 '19 22:10 vlerants

If you are using androidx than try going to node_modules/react-native-admob , find the files from where you are getting the error and replace import android.support.annotation.Nullable; with import androidx.annotation.Nullable;

I hope this helps.

If you get Override error you may want to comment these lines on

    @Override
     public void onRewardedVideoCompleted() {
         sendEvent(EVENT_VIDEO_COMPLETED, null);
     }

on this file /node_modules/react-native-admob/android/src/main/java/com/sbugert/rnadmob/RNAdMobRewardedVideoAdModule.java

vlerants avatar Oct 07 '19 22:10 vlerants

@Override 
     public  void onRewardsVideoCompleted () { 
         sendEvent ( EVENT_VIDEO_COMPLETED , null ); 
     }

in my case this method not added in class node_modules/react-native-admob/android/src/main/java/com/sbugert/rnadmob/RNAdMobRewardedVideoAdModule.java

/node_modules/react-native-admob/android/src/main/java/com/sbugert/rnadmob/RNAdMobRewarde dVideoAdModule.java:20: error: RNAdMobRewardedVideoAdModule is not abstract and does not override abstract method onRewardedVid eoCompleted() in RewardedVideoAdListener public class RNAdMobRewardedVideoAdModule extends ReactContextBaseJavaModule implements RewardedVideoAdListener { ^ 1 error

FAILURE: Build failed with an exception.

JosueAshton avatar Oct 31 '19 02:10 JosueAshton

+1

canerd7u avatar Mar 14 '20 22:03 canerd7u

the solution a preetty worse workaround. it should solve in the codebase.

ue avatar Apr 05 '20 18:04 ue

not working those solution please share other...

patel-harshal avatar Apr 22 '21 05:04 patel-harshal