AdMob ads not appearing on my project

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Jonas Marma

I am trying to show a rewarded video in my mobile game but it seems like I can’t load the admob. I basically coppied the code from the Shin-Nil admob for Godot 3 example and made some alterations (link below)

The example project already works fine on my device, so I think it must be a problem in my project.

var admob = null
var isReal = false
var isTop = true
var adBannerId = "ca-app-pub-3940256099942544/6300978111" # test id
var adInterstitialId = "ca-app-pub-3940256099942544/1033173712" 
var adRewardedId = "ca-app-pub-3940256099942544/8691691433" 
var debug = null
var isbieunguloaded = false
var istrunggianloaded = false

func _ready():
	if(Engine.has_singleton("AdMob")):
		admob = Engine.get_singleton("AdMob")
		admob.init(isReal, get_instance_id())
		loadBanner()
		loadInterstitial()
		loadRewardedVideo()
	else:
		print("No admob singleton")

<Some code not relevant do ads>

# Loaders
func loadRewardedVideo():
	if admob != null:
		admob.loadRewardedVideo(adRewardedId)

# Events

func _on_BtnRewardedVideo_pressed():
	if admob != null:
		print("admob != null: showing video")
		admob.showRewardedVideo()
	print("null admob")

func _on_admob_network_error():
	print("Network Error")
	if(Engine.has_singleton("AdMob")):
		admob = Engine.get_singleton("AdMob")
		admob.init(isReal, get_instance_id())
		loadBanner()


func _on_rewarded_video_ad_loaded():
	print("Rewarded loaded success")
	#get_node("CanvasLayer/BtnRewardedVideo").set_disabled(false)
	
func _on_rewarded_video_ad_closed():
	print("Rewarded closed")
	#get_node("CanvasLayer/BtnRewardedVideo").set_disabled(true)
	loadRewardedVideo()
	
func _on_rewarded(currency, amount):
	print("Reward: " + currency + ", " + str(amount))
	#get_node("CanvasLayer/LblRewarded").set_text("Reward: " + currency + ", " + str(amount))
	

func _on_get_magnets_released():
	_on_BtnRewardedVideo_pressed()

When I run that project on my device, it Outputs “No admob singleton”, so I can’t initiate the admob variable (look at the if-else loop on the _ready function). Am I forgetting to do something.

I have spotted another problem: The projects settings for the example project that is working and my project are different, as seen in the image below. The android menu is missing. I am pretty sure this is causing the problem, but I don’t know how to solve it.
enter image description here

I am sorry for any spelling errors, English is not my main language.

I can’t help with your question but just wanted to say your English is really good, no need to apologise for it :slight_smile:

SleepyTom | 2018-12-27 08:20

Oh! Thank you!

Jonas Marma | 2018-12-27 12:28

Which version of godot are u using

code | 2018-12-27 13:56

It is Godot 3.0.6

Jonas Marma | 2018-12-27 15:00

how did you solve the problem

radome | 2022-01-27 17:53

:bust_in_silhouette: Reply From: att

You must add the admob source code under the Godot Engine’s modules directory, and compile it, and also compile the export template. Hope to help you!

can you explain in details? how n where i can find modules directory? i’m using mac version of godot

atopetrick | 2019-04-19 12:51

:bust_in_silhouette: Reply From: XxcringekidxX

you can do this helps I did it and it works:

https://docs.google.com/document/d/1BUGIScyeRvhPU1x8OStwamNJz8qakHqWFMZDHYi5P3w/edit?usp=sharing

also if that doesn’t work use this apk then try again;
https://drive.google.com/file/d/1zJ1XhX2Vw3vsn-UEZBF9rzsK2jdppjGO/view?usp=sharing

:bust_in_silhouette: Reply From: DrMoriarty

In Godot 3.2.3 you can use binary precompiled modules for mediation networks: Applovin-MAX and Tapdaq. Both of them allow you use several ad networks, for example AdMob and Facebook audience networks.
All binary modules and adapters can be installed from NativeLib repository. NativeLib addon you can find in AssetLib.
More info:

:bust_in_silhouette: Reply From: bender
  1. Here there is a DEMO directory with a working example for AdMob.
    In my case it works.
    GitHub - Shin-NiL/Godot-Android-Admob-Plugin: Android AdMob plugin for Godot Game Engine 3.2 or higher
    https://github.com/Shin-NiL/Godot-Android-Admob-Plugin/tree/main/demo

My case is:
godot 3.2.3
android 9
android platform 29
development environment ubuntu 18
AdMob 4.1.1
JDK11

  1. This is the main tutorial.
    GitHub - Shin-NiL/Godot-Android-Admob-Plugin: Android AdMob plugin for Godot Game Engine 3.2 or higher
    In this tutorial, for me, the step about connect signals isn’t clear (quote: And connect its signals) .

So I upload an image to show it better

  1. Some useful links
    Youtube: Make AdMob work with Godot 3.2.3, 2020 Nov, Arcane Energy.
    https://www.youtube.com/watch?v=PMegf5aIUYs
    GitHub - Shin-NiL/Godot-Android-Admob-Plugin: Android AdMob plugin for Godot Game Engine 3.2 or higher
    https://github.com/Shin-NiL/Godot-Android-AdMob-Plugin/releases