capacitor-community / admob

Community plugin for using Google AdMob
MIT License
219 stars 68 forks source link

Unable to obtain a JavascriptEngine #329

Open aliexalter opened 1 month ago

aliexalter commented 1 month ago

Describe the bug Running application on device with real AdUnits and on simulator with Test Ad Units. I counter an error saying Sending plugin error: {"save":false,"callbackId":"33634438","pluginId":"AdMob","methodName":"prepareInterstitial","success":false,"error":{"message":"Unable to obtain a JavascriptEngine."}} Ad failed to load : 0 File: https://localhost/main.46b33a8cc361aa8b.js - Line 1 - Msg: ERROR Error: Unable to obtain a JavascriptEngine.

To Reproduce Run the demo in android studio using ionic cap open android and chose latest android 14.0 in simulators. User will see no Ads loaded.

Expected behavior Ad should be loaded

Desktop (please complete the following information): None

Smartphone (please complete the following information):

Additional context It is related to WebView in latest Android versions.

aliexalter commented 1 month ago

this might fix but I have not tested on device yet but its working on android 14 simulator.

dependencies {
    implementation("androidx.javascriptengine:javascriptengine:1.0.0-beta01")
}

variable.gradle minSdkVersion = 26