mauville-technologies / PGSGP

Play Games Services plugin for Godot Game Engine 3.3.x - Android
MIT License
29 stars 9 forks source link

Stack trace and crash on login #10

Open finepointcgi opened 2 years ago

finepointcgi commented 2 years ago

Hey! Im using this addon and everytime I try to login I get a stack trace saying its expecting an interface and got a class

12-29 12:00:31.036 19327 19327 D AndroidRuntime: Shutting down VM
12-29 12:00:31.037 19327 19327 E AndroidRuntime: FATAL EXCEPTION: main
12-29 12:00:31.037 19327 19327 E AndroidRuntime: Process: org.finepointcgi.gspp, PID: 19327
12-29 12:00:31.037 19327 19327 E AndroidRuntime: java.lang.IncompatibleClassChangeError: Found class com.google.android.gms.games.GamesClient, but interface was expected (declaration of 'com.google.android.gms.games.GamesClient' appears in /data/app/~~wB3kvUyirHWGIFARPNOpTQ==/org.finepointcgi.gspp-sTsf8cvrH5c50A2Gb7rwoA==/base.apk)
12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at io.cgisca.godot.gpgs.signin.SignInController.enablePopUps(SignInController.kt:104)
12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at io.cgisca.godot.gpgs.signin.SignInController.access$enablePopUps(SignInController.kt:12)
12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at io.cgisca.godot.gpgs.signin.SignInController$signIn$1.onComplete(SignInController.kt:52)
12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at com.google.android.gms.tasks.zzj.run(Unknown Source:4)
12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:938)
12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:99)
12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at android.os.Looper.loopOnce(Looper.java:201)
12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:288)
12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7842)
12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

I do end up getting my login in so the code itself seems to work however it always crashes on me or I get an error 10 depending on how the codes mood is.

Im using Godot 3.4 with Java 11

finepointcgi commented 2 years ago

It looks like if you disable popup it will not trigger this issues, however if I fire off and achievement I get another crash and stacktrace

12-29 12:39:03.109 21427 21427 E AndroidRuntime: FATAL EXCEPTION: main
12-29 12:39:03.109 21427 21427 E AndroidRuntime: Process: org.finepointcgi.gspp, PID: 21427
12-29 12:39:03.109 21427 21427 E AndroidRuntime: java.lang.IncompatibleClassChangeError: Found class com.google.android.gms.games.AchievementsClient, but interface was expected (declaration of 'com.google.android.gms.games.AchievementsClient' appears in /data/app/~~-5Qt9kLPsIBqWOJhjI5VSw==/org.finepointcgi.gspp-WpugocuKF66A0L06MHyN1w==/base.apk)
12-29 12:39:03.109 21427 21427 E AndroidRuntime:        at io.cgisca.godot.gpgs.achievements.AchievementsController.unlockAchievement(AchievementsController.kt:24)
12-29 12:39:03.109 21427 21427 E AndroidRuntime:        at io.cgisca.godot.gpgs.PlayGameServicesGodot$unlockAchievement$1.run(PlayGameServicesGodot.kt:244)
12-29 12:39:03.109 21427 21427 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:938)
12-29 12:39:03.109 21427 21427 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:99)
12-29 12:39:03.109 21427 21427 E AndroidRuntime:        at android.os.Looper.loopOnce(Looper.java:201)
12-29 12:39:03.109 21427 21427 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:288)
12-29 12:39:03.109 21427 21427 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7842)
12-29 12:39:03.109 21427 21427 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
12-29 12:39:03.109 21427 21427 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
12-29 12:39:03.109 21427 21427 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
finepointcgi commented 2 years ago

This is still an issue however I figured out how to get it all to work. you need to make sure you have both web and android authentication on your app. image and make sure you have both authes in your app image

BE SURE TO PUBLISH THEM OR IT WILL NOT WORK

finally be sure to set your token in the code the read me says nothing of this but it will cause a full crash on your app causing this stack trace image The client id is the WEB not the android one.