[BUG] has_singleton("AdMob") fails in sample project
See original GitHub issueDescribe the bug
I’m attempting to run the sample project on an LG G3 Android. The project works and deploys correctly, but none of the buttons seemed to be doing anything for me. After some digging, I’ve made the following modification to admob_api/AdMob.gd
’s ready function:
func _ready():
if admob_enabled:
if (Engine.has_singleton("AdMob")):
_admob_singleton = Engine.get_singleton("AdMob")
#_admob_singleton = self
print("admob singleton: %s" % _admob_singleton)
_initialize()
# warning-ignore:return_value_discarded
get_tree().connect("screen_resized", self, "_on_get_tree_resized")
else:
print("Singleton check fails")
And when debugging, it prints “Singleton check fails”. I’m a little confused about the fact that AdMob.tscn is a Autoload Singleton that gets checked, when the check is already being called from within AdMob.gd, which I think is the script for AdMob.tscn.
Regardless, am I missing something setup wise? I’ve gone through the install instructions, setup Android custom build and everything seems alright from that standpoint, it’s just this Singleton loading I can’t get working.
To Reproduce Steps to reproduce the behavior: Just run the example project with the modifications listed above.
Expected behavior Expected AdMob singleton to load, and ad callbacks on button presses.
Screenshots Don’t believe any are necessary just yet.
Smartphone (please complete the following information):
- Device: LG G3
- OS: Android 5.0.2
- Godot Version: 3.2.3
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
@gustavottc Got it working. Pulled the latest down from the repo, went through the configuration steps again. One thing I definitely had wrong was I was using the App Unit Id rather than the App Id, although it’s very possible I had something else incorrect as well, but it’s working now!
Thanks for the help, liking what I’m seeing so far here!
@gustavottc I had gone through everything in the first link, and it was the example project I was trying to get working. I only modified
AdMob.api
because I was trying to debug my issue.Your apk does work for me, so I’m going to go through everything again just to make sure I didn’t miss a step.