EMI-INDO / emi-indo-cordova-plugin-admob

Cordova Plugin Admob Android | IOS
ISC License
12 stars 2 forks source link

cordova build failed after adding this plugin #9

Closed krestia closed 1 year ago

krestia commented 1 year ago

i try to build with hello cordova and success build an .apk, but when i add this plugin, it always fail

BUILD FAILED in 18s D:\5.GAME\Cordova\1new\hello\platforms\android\gradlew: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.

EMI-INDO commented 1 year ago

@krestia

Required

Cordova CLI version

krestia commented 1 year ago

@EMI-INDO

Hi, I used default cordova project : cordova create hello , then add this plugin and result failed

i used your example and adding it in index.html, result failed

D:\5.GAME\Cordova\1new\hello>node -v v18.14.1

D:\5.GAME\Cordova\1new\hello>gradle -v


Gradle 7.4.2

Build time: 2022-03-31 15:25:29 UTC Revision: 540473b8118064efcc264694cbcaa4b677f61041

Kotlin: 1.5.31 Groovy: 3.0.9 Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021 JVM: 1.8.0_144 (Oracle Corporation 25.144-b01) OS: Windows 8.1 6.3 amd64

D:\5.GAME\Cordova\1new\hello>cordova --version 10.0.0 (cordova-lib@10.1.0)

D:\5.GAME\Cordova\1new\hello>cordova platform is Installed platforms: android 8.1.0 Available platforms: browser ^6.0.0 electron ^1.1.1 windows ^7.0.0

D:\5.GAME\Cordova\1new\hello>cordova plugin is cordova-plugin-whitelist 1.3.5 "Whitelist" emi-indo-cordova-plugin-admob 1.0.9 "emiAdmobPlugin"

i also used androidx and androidx adapter plugin, but doesn't solved the issue

EMI-INDO commented 1 year ago

@krestia

remove

add new

If there are still problems contact me back

krestia commented 1 year ago

@EMI-INDO

Hi, many thanks

it is work!

D:\5.GAME\Cordova\1new\hello>cordova --version 10.0.0 (cordova-lib@10.1.0)

D:\5.GAME\Cordova\1new\hello>cordova platforms is Installed platforms: android 11.0.0 Available platforms: browser ^6.0.0 electron ^1.1.1 windows ^7.0.0

D:\5.GAME\Cordova\1new\hello>cordova plugin is cordova-plugin-whitelist 1.3.5 "Whitelist" emi-indo-cordova-plugin-admob 1.0.9 "emiAdmobPlugin"

EMI-INDO commented 1 year ago

@krestia

If you are using cordova 11.0.0 please delete cordova-plugin-whitelist

If you fail to build apk

krestia commented 1 year ago

@EMI-INDO

yes i build an .apk succesfully with your suggestion.

i used your template code (.js) and (.html) but the ads not showing. because i am not sure what i.m missing, show i don't mention it in my reply before.

your sugestion : If you are using cordova 11.0.0 please delete cordova-plugin-whitelist

cordova plugin rm cordova-plugin-whitelist

add in config.xml

AndroidXEnabled = true `

` **for this :** **i have add this preference already.** **ok, i'll try it, may it is cause that error** **belllow is in my config.xml :** ` HelloCordova A sample Apache Cordova application that responds to the deviceready event. Apache Cordova Team ` **but still the ads doesn't showing.**
EMI-INDO commented 1 year ago

@krestia

When using test ads, or real ads, you must still use the com.xxxxxxx package name that already exists in the play store.

Do not test real ads directly, admob account will be suspended.

To test real ads you must upload the apk/aab in the play store, until the release is approved, you must download it directly from the play store, do not click on ads in the application itself it can cause ad serving to be limited.

https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/discussions/11

krestia commented 1 year ago

@EMI-INDO Thanks, I take down my comment before.

with last setting, my interstitial ads showed but in blank screen. For me, it because of the ads (function) do not work in eventlistener function (document.addEventListener("deviceready", function()) through index.html, but it must called in runtime.

your plugin and example working good, it is only in my app that need some adjustment.

i can close this issue