0 votes

I am trying to add test ads using the following plugin https://github.com/ShinNiL/Godot-Android-Admob-Plugin/releases/tag/v4.0.0 .

I am using Godot 3.2.2. It is working fine with banner ads(test ads) but interstitial ads are not showing up. The logcat says that interstitial ads are not being loaded.

Below is my code. I created a Node2D and did the following.

var node = preload("res://AdMob.tscn")
var admob
func instance_interstitial():
   admob = node.instance()
   admob.init()
   admob.load_interstitial()
   admob.show_interstitial()
func ready():
   instance_interstitial()

And below is the relevant logcat. On the third line from bottom it says interstitial ad not loaded.

***10-04 13:10:31.654 31853 31901 D godot   : AdMob: init with content rating options
10-04 13:10:31.728 31853 31853 I ngine.firstgam: The ClassLoaderContext is a special shared library.***
10-04 13:10:31.734 31853 31853 I chatty  : uid=10192(org.godotengine.firstgame) identical 1 line
10-04 13:10:31.739 31853 31853 I ngine.firstgam: The ClassLoaderContext is a special shared library.
10-04 13:10:31.741 30216 30216 W TcmReceiver: type=1400 audit(0.0:73684): avc: denied { write } for name="tcm" dev="tmpfs" ino=22601 scontext=u:r:updater:s0:c512,c768 tcontext=u:object_r:dpmtcm_socket:s0 tclass=sock_file permissive=0
***10-04 13:10:31.831 31853 31853 I DynamiteModule: Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:22000
10-04 13:10:31.831 31853 31853 I DynamiteModule: Selected remote version of com.google.android.gms.ads.dynamite, version >= 22000
10-04 13:10:31.836 31853 31853 D DynamitePackage: Instantiated singleton DynamitePackage.
10-04 13:10:31.836 31853 31853 D DynamitePackage: Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
10-04 13:10:31.878 31853 31853 I Ads     : Updating ad debug logging enablement***.
10-04 13:10:31.885  2021  3011 D CompatibilityInfo: mCompatibilityFlags - 0
10-04 13:10:31.885  2021  3011 D CompatibilityInfo: applicationDensity - 320
10-04 13:10:31.885  2021  3011 D CompatibilityInfo: applicationScale - 1.0
10-04 13:10:31.894 31853 31949 D NetworkSecurityConfig: No Network Security Config specified, using platform default
***10-04 13:10:31.900 31853 31853 I Ads     : This request is sent from a test device.***
10-04 13:10:31.920 31853 31853 W ngine.firstgam: Accessing hidden field Ljava/nio/Buffer;->address:J (light greylist, reflection)
10-04 13:10:31.952  2021  3011 D CompatibilityInfo: mCompatibilityFlags - 0
10-04 13:10:31.952  2021  3011 D CompatibilityInfo: applicationDensity - 320
10-04 13:10:31.952  2021  3011 D CompatibilityInfo: applicationScale - 1.0
10-04 13:10:31.966 31853 31951 I ngine.firstgam: The ClassLoaderContext is a special shared library.
***10-04 13:10:31.972 31853 31853 I DynamiteModule: Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:22000
10-04 13:10:31.972 31853 31853 I DynamiteModule: Selected remote version of com.google.android.gms.ads.dynamite, version >= 22000***
10-04 13:10:32.064 31853 31981 I AudioManager: In isSpeakerphoneOn(), calling application: org.godotengine.firstgame
10-04 13:10:32.065  2021  3011 I AudioService: In isSpeakerphoneOn(), mForcedUseForCommExt: 0
10-04 13:10:32.078 31853 31981 D AudioManager: getStreamVolume isRestricted mode = 0
10-04 13:10:32.080   515   515 D audio_hw_spkr_prot: audio_extn_fbsp_get_parameters: Speaker protection disabled
10-04 13:10:32.083   515   515 D audio_hw_extn: audio_extn_get_parameters: returns 
10-04 13:10:32.086   564 16941 I hash_map_utils: key: 'hifi_mode' value: ''
10-04 13:10:32.093 31853 31981 D AudioManager: getStreamVolume isRestricted mode = 0
10-04 13:10:32.118 31853 31853 I WebViewFactory: Loading com.android.chrome version 71.0.3578.99 (code 357809952)
10-04 13:10:32.311 32472 32488 W LocalConnector: Cannot connect the wmserver-data-reciever
10-04 13:10:32.402 31853 31853 I cr_LibraryLoader: Time to load native libraries: 6 ms (timestamps 2705-2711)
10-04 13:10:32.441 31853 31853 I chromium: [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0
10-04 13:10:32.442 31853 31853 I cr_LibraryLoader: Expected native library version number "71.0.3578.99", actual native library version number "71.0.3578.99"
10-04 13:10:32.450  2021  3011 D CompatibilityInfo: mCompatibilityFlags - 0
10-04 13:10:32.450  2021  3011 D CompatibilityInfo: applicationDensity - 320
10-04 13:10:32.450  2021  3011 D CompatibilityInfo: applicationScale - 1.0
10-04 13:10:32.536  2021  2037 D Boost   : hostingType=service, hostingName=com.android.chrome/org.chromium.android_webview.services.VariationsSeedServer, callerPackage=org.godotengine.firstgame, isSystem=false, isBoostNeeded=false.
10-04 13:10:32.537  2021  2037 I ActivityManager: Start proc 32001:com.android.chrome:webview_service/u0a126 for service com.android.chrome/org.chromium.android_webview.services.VariationsSeedServer caller=org.godotengine.firstgame
10-04 13:10:32.538 32590 32634 D PowerKeeper.Event: notifyAMProcStart processName: 10126 reason: com.android.chrome:webview_service, pid:0
***10-04 13:10:32.541 31853 31853 W w       : AdMob: showInterstitial - interstitial not loaded***
10-04 13:10:32.551 31853 31953 W Ads     : Update ad debug logging enablement as false
10-04 13:10:32.553 32001 32001 E webview_servic: Not starting debugger since process cannot load the jdwp agent.

Thanks for your time.

in Engine by (20 points)

It is because you are calling showinterstitial() before the Ad is actually being loaded. It take some seconds for the Ad to get loaded (depends on connection). Call showinterstitial() after isinterstitialloaded() returns True.

Thanks, It works now.

1 Answer

0 votes

For Godot 3.2.3 you can use precompiled binary modules for mediation networks: AppLovin-MAX and Tapdaq. Both of them allow you use several ad networks at the same time. For example you can connect AdMob and Facebook audience network to you application.
All binary modules can be installed from NativeLib repository. NativeLib addon you can find at AssetLib.
More info:
https://github.com/DrMoriarty/nativelib
https://github.com/DrMoriarty/godot-tapdaq
https://github.com/DrMoriarty/godot-applovin-max

by (206 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.