how do i detect if user presses on ad so i can hide/unload it
for me seems like there is no way from its current API to do so since callback function is only called upon load() or when user presses (x) or back while interstitial is showing
i am aware that this wast just an example extension but for someone who is unable to read or extend it this is his only hope 
pls dont point me to Enhance, i tried it and my 4mb game grew to 20mb 
1 Like
Perhaps itâs an option to use the AdMob extension from the community?
3 Likes
i was also looking into it and couldnât get it working on android
some kind of âresourceâ error appears even if i do +workaround+ steps as described in readme doc
both in editor 1 and 2
in values.xml file i get error adSize , adUnitId are already defined
Hmm, I donât know exactly what those problems mean. Perhaps @sergey.lerg knows more?
hey, i got it working i just renamed these lines from values.xml file and it built successfully
attr name=âadSizeâ format=âstringâ/>
to attr name=âadSize1â format=âstringâ/
attr name=âadUnitIdâ format=âstringâ/
to attr name=âadUnitId1â format=âstringâ/
although i am not sure if this is healthy even if the demo seems like working perfectly i have no idea why those two lines caused error
1 Like
Hi, make sure you are using the game.appmanifest file. It tells Defold to exclude itâs own google play services lib.
That file has to be selected in game.project settings under ânative_extensionâ section.
i did everything still i cant build for android until i rename those two lines
can you please check if this is caused by multiple definition of variable in
java/com/google/android/gmscore/integ/client/admob/res/values/ads_attrs.xml
and
\lerg_admob_test\admob\res\android\res\values\values.xml
at line 84 and 88
Thatâs Defoldâs internal file, it should be excluded by that game.appmanifest file.
Please double check it, copy the file into the root of your project, make sure it says
platforms:
armv7-android:
context:
excludeJars: ["(.*)/google-play-services.jar", "(.*)/android-support-v4.jar"]
And is correctly picked up in game.project file.
it was like that from the beginning
Hmmmmm. Any other extensions?
i have a project with defolds admob extension and it builds with no problems in both editor 1 and 2
its using the same game.appmanifest content
So if you download the project from github https://github.com/Lerg/extension-admob
and open it in Defold as is, it makes that error?
yes sir
has anyone else complained about this ?
Nope, you are the first. What OS?
Windows 7
i mean, it is obvious that the file is not excluded for some reason
is it safe to go with my renaming solution ?
It is strange. But do try using the extension with renaming (you can delete them instead), if Defolds google play services jar doesnât get excluded you will get runtime errors on using the sample app. If no errors - you are good to go.
everything works banner can show , rewarded video etc.
except one thing
if i press â initâ, âload interstitialâ, âshow interstitialâ , and close ad by (x) or back button , then if i press again âload interstitialâ , app crashes instantly
but if i press âinitâ every time before âload interstitialâ button it works as expected
Iâm getting the same error too on the same lines in values.xml even the fact that i followed every step and included the game.appmanifest
I can confirm. Building doesnât work on Windows, but works on macOS.
1 Like