I implemented a video ad using react-native-admob. When I built it this morning, the app that should have worked properly suddenly failed to build.
> Task :react-native-admob:compileDebugJavaWithJavac FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings
22 actionable tasks: 2 executed, 20 up-to-date
/prj/node_modules/react-native-admob/android/src/main/java/com/sbugert/rnadmob/RNAdMobInterstitialAdModule.java:20: error: cannot find symbol.
import com.google.android.gms.ads.InterstitialAd;
^
symbol: class InterstitialAd
location: package com.google.android.gms.ads
/prj/node_modules/react-native-admob/android/src/main/java/com/sbugert/rnadmob/RNAdMobInterstitialAdModule.java:36: error: cannot find symbol.
InterstitialAd mInterstitialAd;
^
symbol: class InterstitialAd
location: class RNAdMobInterstitialAdModule
The development environment is as follows.
- react:16.9.0
- react-native:0.61.5
- Gradle:3.5.4
- Android 10 emulator
- react-native-admob:2.0.0-beta.6
- Android Studio:4.1.1
I have tried the following.
- Add the following to app / build.gradle
configurations.all {
resolutionStrategy {
force "com.google.android.gms:play-services-basement:17.0.0"
force "com.google.android.gms:play-services-base:17.1.0"
force "com.google.android.gms:play-services-stats:17.0.0"
force "com.google.android.gms:play-services-gcm:17.0.0"
force "com.google.android.gms:play-services-ads:19.7.0"
}
}
- Change From com.google.android.gms:play-services-ads:19.1.0 to com.google.android.gms:play-services-ads:19.7.0
- Change from react-native-admob@2.0.0-beta.6 to react-native-admob@1.3.2
- gradlew cache clean
- node_modules delete and npm install
Please let me know if there is a solution.