PGSGP
PGSGP copied to clipboard
Godot cannot be cast to android.app.Activity
Godot version: 3.3.2
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.
Probably these lines should be updated:
https://github.com/cgisca/PGSGP/blob/8a47c95620c58c4d357ed50aef2e2c722a875050/app/src/main/java/io/cgisca/godot/gpgs/PlayGameServicesGodot.kt#L185-L194
I get this same error, How to update these lines? it is not on my project.
So what I did was cloned the repo, altered the line, made it depend on Godot 3.3.2 and rebuild the plugin. That did the trick. But it is in no shape to be made in a PR I'm afraid because I didn't really know what I was doing.
Hi @SanderVanhove
Would it be possible for you to create a branch(of the changes you made) and share here. Seems like lot of people are facing the same issue.
Facing the same issue here...would appreciate some assistance.
Use https://github.com/cgisca/PGSGP/pull/63
This PR has support for 3.3.2
Whoops sorry for reacting so late 😅 Yeah that PR seems to implement the right changes.