question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Godot cannot be cast to android.app.Activity

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
vipulbehlcommented, Jul 16, 2021

Use https://github.com/cgisca/PGSGP/pull/63

This PR has support for 3.3.2

0reactions
SanderVanhovecommented, Jul 17, 2021

Whoops sorry for reacting so late 😅 Yeah that PR seems to implement the right changes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to verify Onesignal after Android export - Godot Engine
So I was trying to update my godot engine from 3.2.3 to 3.3.4, after fixing a lot of ... app when we export...
Read more >
Fatal exception on Godot 3.3.2 · Issue #68 · cgisca/PGSGP
ClassCastException: org.godotengine.godot.Godot cannot be cast to android.app.Activity at io.cgisca.godot.gpgs.
Read more >
android.app.Application cannot be cast to android.app.Activity
you get this exception because you can't cast the Application to Activity since Application is not a sub-class of Activity . Share.
Read more >
JNI Error While Loading Android Game : r/godot - Reddit
org.godotengine.godot.Godot cannot be cast to android.app.Activity. java_vm_ext.cc:578] at void io.cgisca.godot.gpgs.
Read more >
Application Fundamentals - Android Developers
Because the system runs each app in a separate process with file permissions that restrict access to other apps, your app cannot directly...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found