Open danieldanielecki opened 8 months ago
Hi, I have read your message and found it useful for another reason. So thanks 🥇 But since i'm already here, i can give you a hint maybe: i am testing the version 2.0.0-alpha.13 and i could show an interstitial on my android device. And i don't have any compiling error on cordova/android. So maybe you can try 2.0.0-alpha.13, or maybe uninstall/re-install cordova + plugin + platform andoid? I have cordova 12.0.0 (cordova-lib@12.0.1) + platform cordova-android 12.0.1 + admob-plus-cordova 2.0.0-alpha.13. Maybe give it a try. Cheers.
Thanks @bonjourjoel, I haven't seen anything to fix the problem in release notes, so just decided to leave the working solution; with Cordova plugins it's always the moment everyone is waiting for - to get it working:)
Daniel. The 2.0 alpha plugin was written in Kotlin so you'll need to enable Kotlin in your project. Adding the following line to config.xml should do the trick:
<preference name="GradlePluginKotlinEnabled" value="true" />
The installation docs just need updating.
Daniel. The 2.0 alpha plugin was written in Kotlin so you'll need to enable Kotlin in your project. Adding the following line to config.xml should do the trick:
The installation docs just need updating.
Line not visible 😀
Apologies... didn't mark the line as code. Now it should appear just fine. Add that line in your config.xml under the AndroidXEnabled line and you'll get rid of the Didn't find class "admob.plus.cordova.AdMob" errors.
Note: After submitting the comment, I managed to resolve the issue on my own. I have updated my comment to reflect the solution.
Adding that line helped. But I have an incompatibility issue with cordova-plugin-firebasex
I assume. As adding
<preference name="GradlePluginKotlinEnabled" value="true" />
results in a build error:
> Task :app:compileDebugKotlin
e: /Users/john-doe/.gradle/caches/transforms-3/1ee3f7841abe9979797edc39b62bd26a/transformed/jetified-firebase-auth-22.2.0-api.jar!/META-INF/java.com.google.android.gmscore.integ.client.firebase-auth-api_firebase-auth-api.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
e: /Users/john-doe/.gradle/caches/transforms-3/dade25bead44bca314189166709326d8/transformed/jetified-play-services-measurement-api-21.5.0-api.jar!/META-INF/java.com.google.android.gmscore.integ.client.measurement_api_measurement_api.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
> Task :app:compileDebugKotlin FAILED
When I specify the Gradle version to 1.9.0
as follows:
<preference name="GradlePluginKotlinEnabled" value="true" />
<preference name="GradlePluginKotlinVersion" value="1.9.0" />
The build now fails with
> Task :app:compileDebugKotlin
e: The Android extensions ('kotlin-android-extensions') compiler plugin is no longer supported. Please use kotlin parcelize and view binding. More information: https://goo.gle/kotlin-android-extensions-deprecation
> Task :app:compileDebugKotlin FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
I could fix this by commenting out the 'kotlin-android-extensions
line in android/app/build.gradle
:
if (cordovaConfig.IS_GRADLE_PLUGIN_KOTLIN_ENABLED) {
apply plugin: 'kotlin-android'
// apply plugin: 'kotlin-android-extensions'
}
After doing so, everything worked for me.
The version 2 doesn't work on
Android
device/simulator. Didn't tryiOS
, yet, and I'm gonna to keep on1.28.0
.While being on the latest version (that time
2.0.0-alpha.8
) I've noticed several errors while trying to launch the AdMob ads:W/System.err: java.lang.ClassNotFoundException: admob.plus.cordova.AdMob
java.lang.ClassNotFoundException: admob.plus.cordova.AdMob
I had to revert back to
1.28.0
in https://github.com/Doyban/TappyPlane/commit/cab533f5e1db34a519c242ab2243ebae675ca578 to get AdMob working.I'm aware it's just
alpha
, but from the docs I understood it's working, but that's not the case.