sbugert / react-native-admob

A react-native component for Google AdMob banners
BSD 2-Clause "Simplified" License
1.13k stars 532 forks source link

Task :react-native-admob:compileReleaseJavaWithJavac FAILED #470

Open mxvsh opened 4 years ago

mxvsh commented 4 years ago

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

vlerants commented 4 years ago

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 commented 4 years ago

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

JosueAshton commented 4 years ago
@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.

canerd7u commented 4 years ago

+1

ue commented 4 years ago

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

patel-harshal commented 3 years ago

not working those solution please share other...