Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admob is not detected in 3.1.1 #108

Open
wamiqurrehman093 opened this issue Oct 23, 2019 · 15 comments
Open

Admob is not detected in 3.1.1 #108

wamiqurrehman093 opened this issue Oct 23, 2019 · 15 comments
Labels

Comments

@wamiqurrehman093
Copy link

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:

[android]
modules="org/godotengine/godot/GodotAdMob"

but still I get false whenever I try to load the Admob
print(Engine.has_singleton("GodotAdMob"))

@Shin-NiL
Copy link
Collaborator

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.

@wamiqurrehman093
Copy link
Author

yes it has these lines

[android]
modules="org/godotengine/godot/GodotAdmob"

@Shin-NiL
Copy link
Collaborator

Does the example project work?

@Shin-NiL
Copy link
Collaborator

Oh, I see, the singleton name is AdMob:

Engine.has_singleton("AdMob")

@wamiqurrehman093
Copy link
Author

example is not working and yes I tried that too but didn't work then I put "GodotAdMob" and still didn't work

@wamiqurrehman093
Copy link
Author

wait rewarded video worked on example when I deployed on my phone

@wamiqurrehman093
Copy link
Author

only reward video worked nothing else

@wamiqurrehman093
Copy link
Author

interstitial and banners not working

@Shin-NiL
Copy link
Collaborator

Take a look at the logs using logcat. The example is working fine to me.

@Gnumaru
Copy link

Gnumaru commented Oct 26, 2019

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

@Gnumaru
Copy link

Gnumaru commented Oct 26, 2019

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.

@carcedogames
Copy link

Can someone provide me with the .exe with the admob module already compiled?, Thanks

@Shin-NiL
Copy link
Collaborator

@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
Copy link

Gnumaru commented Oct 29, 2019

@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.

@gumaciel
Copy link
Collaborator

gumaciel commented May 5, 2020

@Gnumaru @wamiqurrehman093 the problem still persists?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants