Open wamiqurrehman093 opened 4 years ago
Open your project.godot
file and check again to see if your changes stills there. If you edit this file with the godot editor open, it most likely was overwritten. Edit and save the file with the Godot editor closed then try again.
yes it has these lines
[android]
modules="org/godotengine/godot/GodotAdmob"
Does the example project work?
Oh, I see, the singleton name is AdMob
:
Engine.has_singleton("AdMob")
example is not working and yes I tried that too but didn't work then I put "GodotAdMob" and still didn't work
wait rewarded video worked on example when I deployed on my phone
only reward video worked nothing else
interstitial and banners not working
Take a look at the logs using logcat. The example is working fine to me.
Could it be something related to the admob network? Some days ago my project was running fine. This morning my project was showing the admob test banners but crashed when trying to show the interstitials. Some time later the project starting crashing always. After some tests I discovered that even though "Engine.has_singleton('AdMob')" was returning true, when I tried "Engine.get_singleton('AdMob')" the game crashed. Here is the relevant part of the logcat messages
D/AndroidRuntime( 4808): Shutting down VM
E/AndroidRuntime( 4808): FATAL EXCEPTION: main
E/AndroidRuntime( 4808): Process: com.mycompany.mygame, PID: 4808
E/AndroidRuntime( 4808): java.lang.NullPointerException: Attempt to invoke virtual method 'int com.google.android.gms.ads.AdView.getVisibility()' on a null object reference
E/AndroidRuntime( 4808): at org.godotengine.godot.GodotAdMob$5.run(GodotAdMob.java:286)
E/AndroidRuntime( 4808): at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime( 4808): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime( 4808): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 4808): at android.app.ActivityThread.main(ActivityThread.java:5293)
E/AndroidRuntime( 4808): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 4808): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 4808): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
E/AndroidRuntime( 4808): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
W/ActivityManager( 1725): Force finishing activity 1 com.mycompany.mygame/org.godotengine.godot.Godot
E/EGL_emulation( 1422): tid 1422: eglCreateSyncKHR(1479): error 0x3004 (EGL_BAD_ATTRIBUTE)
W/WindowManager( 1725): updateFocusedWindowLocked, focusedAppToken is null.
E/EGL_emulation( 1422): tid 1422: eglCreateSyncKHR(1479): error 0x3004 (EGL_BAD_ATTRIBUTE)
D/SurfaceFlinger( 1422): setOrientation, mFbdev=0xb68616c0, mFbDev->setOrientation=0xb7002060, orientation=0
I managed to solve my problem. I was trying to get the admob singleton on a _ready function of another singleton. I moved to logic to a _ready function of a normal object and it worked fine. Oddly, my setup was working before but then stopped working without reason. It could be something related to the loading order of the singletons and the time needed to setup the admob java objects from the java side.
Can someone provide me with the .exe with the admob module already compiled?, Thanks
@Gnumaru this module is working only up to Godot 3.1.1. If you use Godot 3.2 master, it'll crash.
@carcedogames you can find precompiled modules here.
@Gnumaru this module is working only up to Godot 3.1.1. If you use Godot 3.2 master, it'll crash.
Sorry, I forgot to mention these informations. I'm using the oficial 64 bit windows build of latest stable standard (without mono) version of godot, 3.1.1. Nevertheless my problem now seems urelated to this one since for @wamiqurrehman093 even Engine.has_singleton("GodotAdMob") is returning false whereas for me it returned true. I just wanted to point a possible correlation of the two problems but now it doesn't seem to be the case anymore.
@Gnumaru @wamiqurrehman093 the problem still persists?
OS target (Android/iOS): Android
Godot version: 3.1.1
Issue description:
I compiled my own templates and tried this as well [ https://github.com/Shin-NiL/godot-custom-mobile-template/releases ] and put it in my custom package debug and release paths on android export window and also put the:
but still I get false whenever I try to load the Admob
print(Engine.has_singleton("GodotAdMob"))