poo*_*ooh 3 android admob react-native
我使用react-native-admob 实现了一个视频广告。\n当我今天早上构建它时,本应正常运行的应用程序突然无法构建。
\n> Task :react-native-admob:compileDebugJavaWithJavac FAILED\n\nDeprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.\nUse '--warning-mode all' to show the individual deprecation warnings.\nSee https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings\n22 actionable tasks: 2 executed, 20 up-to-date\n/prj/node_modules/react-native-admob/android/src/main/java/com/sbugert/rnadmob/RNAdMobInterstitialAdModule.java:20: error: cannot find symbol.\nimport com.google.android.gms.ads.InterstitialAd;\n ^\n symbol: class InterstitialAd\n location: package com.google.android.gms.ads\n/prj/node_modules/react-native-admob/android/src/main/java/com/sbugert/rnadmob/RNAdMobInterstitialAdModule.java:36: error: cannot find symbol.\n InterstitialAd mInterstitialAd;\n ^\n symbol: class InterstitialAd\n location: class RNAdMobInterstitialAdModule\n\nRun Code Online (Sandbox Code Playgroud)\n开发环境如下。
\n我已经尝试过以下方法。
\nconfigurations.all {\n resolutionStrategy {\n force "com.google.android.gms:play-services-basement:17.0.0"\n force "com.google.android.gms:play-services-base:17.1.0"\n force "com.google.android.gms:play-services-stats:17.0.0"\n force "com.google.android.gms:play-services-gcm:17.0.0"\n force "com.google.android.gms:play-services-ads:19.7.0"\n }\n}\nRun Code Online (Sandbox Code Playgroud)\n如果有解决方案,请告诉我。
\nMuh*_*dar 11
您可以通过替换 node-modules/react-native-admob/android/build.gradle 中的行来解决此问题
replace ==> implementation 'com.google.android.gms:play-services-ads:+.'
With ==>. implementation 'com.google.android.gms:play-services-ads:19.8.0'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3738 次 |
| 最近记录: |