Shin-NiL / Godot-Android-Admob-Plugin

Android AdMob plugin for Godot Game Engine 3.2 or higher
MIT License
543 stars 66 forks source link

Godot 3.3.2 org.godotengine.godot.Godot cannot be cast to android.app.Activity #162

Closed SanderVanhove closed 3 years ago

SanderVanhove commented 3 years ago

Godot version: 3.3.2

AdMob Plugin version: 5.0.0

Issue description:

When I call play_games_services.init(false) I get this error in my logcat:

AndroidRuntime: Process: com.sandervanhove.bouncybox, PID: 27870
AndroidRuntime: java.lang.ClassCastException: org.godotengine.godot.Godot cannot be cast to android.app.Activity
AndroidRuntime:        at io.cgisca.godot.gpgs.PlayGameServicesGodot.initialize(PlayGameServicesGodot.kt:185)
AndroidRuntime:        at io.cgisca.godot.gpgs.PlayGameServicesGodot.init(PlayGameServicesGodot.kt:168)
AndroidRuntime:        at org.godotengine.godot.GodotLib.step(Native Method)
AndroidRuntime:        at org.godotengine.godot.GodotRenderer.onDrawFrame(GodotRenderer.java:60)
AndroidRuntime:        at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1582)
AndroidRuntime:        at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1281)

Maybe this is related to https://github.com/godotengine/godot/issues/47198.

SanderVanhove commented 3 years ago

Woops put this in the wrong repo, please ignore 🤦‍♂️