play-games-plugin-for-unity icon indicating copy to clipboard operation
play-games-plugin-for-unity copied to clipboard

Crash using Unity 2021.3.16f1 and Google Play Games Services 0.11.01 - BIG PROBLEM FOR ME!

Open TheLonelyDeveloper opened this issue 1 year ago • 4 comments

Details : I have GPGS installed in my game for over 2 years. It used to work fine. All of a sudden, around october 2022, i started seeing crashes in my game in the google play developer console, a lot of them. They pointed to GPGS, so I updated to 0.11.01. The game works fine, it connects, i can get achievements, access leaderboards etc, save / load from the cloud, but the crashes still appear in my google play developer console. This is affecting my Android Vitals and causing my game to get penalized, which is obviously not good. Any ideas on how to fix this?

Error displayed by the google play developer console pre-launch testing report :

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1548471545, result=-1, data=null} to activity {com.google.android.gms/com.google.android.gms.games.ui.signinflow.SignInActivity}: java.lang.IllegalStateException: Not connected. Call connect() and wait for onConnected() to be called.

Here are more details :

Exception java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1548471545, result=-1, data=null} to activity {com.google.android.gms/com.google.android.gms.games.ui.signinflow.SignInActivity}: java.lang.IllegalStateException: Not connected. Call connect() and wait for onConnected() to be called. at android.app.ActivityThread.deliverResults (ActivityThread.java:5013) at android.app.ActivityThread.handleSendResult (ActivityThread.java:5054) at android.app.servertransaction.ActivityResultItem.execute (ActivityResultItem.java:51) at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2066) at android.os.Handler.dispatchMessage (Handler.java:106) at android.os.Looper.loop (Looper.java:223) at android.app.ActivityThread.main (ActivityThread.java:7664) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:947) Caused by java.lang.IllegalStateException: Not connected. Call connect() and wait for onConnected() to be called. at m.ggn.e (:com.google.android.gms.optional_games@[email protected] (100000-0)) at m.hpz.aQ (:com.google.android.gms.optional_games@[email protected] (100000-0):7) at m.hpz.T (:com.google.android.gms.optional_games@[email protected] (100000-0):3) at m.bw.a (:com.google.android.gms.optional_games@[email protected] (100000-0):7) at m.sm.e (:com.google.android.gms.optional_games@[email protected] (100000-0):6) at m.cjf.onActivityResult (:com.google.android.gms.optional_games@[email protected] (100000-0)) at m.cjo.onActivityResult (:com.google.android.gms.optional_games@[email protected] (100000-0)) at gwh.public_onActivityResult (:com.google.android.gms@[email protected] (150400-503260631)) at xmf.onActivityResult (:com.google.android.gms@[email protected] (150400-503260631):4) at android.app.Activity.dispatchActivityResult (Activity.java:8304) at android.app.ActivityThread.deliverResults (ActivityThread.java:5006)

The device is a Google Pixel 5, Android 11 (SDK 30)

TheLonelyDeveloper avatar Feb 18 '23 22:02 TheLonelyDeveloper

Hey, I have exactly the same issue, have you found any solution?

ArnaudDroxler avatar Feb 27 '23 07:02 ArnaudDroxler

Hey, I have exactly the same issue, have you found any solution?

No, sadly this keeps happening with Unity 2021.3.19f1 as well. I tried a lot of stuff, changing SDK level, JDK, NDK.. I have changed unity versions, tried many code variations.. nothing seems to fix this. Please let me know if you find any solution!

TheLonelyDeveloper avatar Feb 27 '23 19:02 TheLonelyDeveloper

+1, started noticing this recently, in last week - my every other Play Store submission actually ends up with this error in the crashes report in the pre-launch report details.

I think it happens when the user does not agree to the Oauth consent form, based on the video, and therefore the user is not logged in.

Logcat contains also the following two stack traces 03-01 23:57:25.672: E/AuthPII(21374): [GoogleAccountDataServiceImpl] getToken() -> BAD_AUTHENTICATION. App: com.google.android.gms, Service: oauth2:https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/account.capabilities https://www.googleapis.com/auth/account.service_flags 03-01 23:57:25.672: E/AuthPII(21374): zpc: Long live credential not available. 03-01 23:57:25.672: E/AuthPII(21374): at lgl.a(:com.google.android.gms@[email protected] (190400-509319212):8) 03-01 23:57:25.672: E/AuthPII(21374): at lgs.c(:com.google.android.gms@[email protected] (190400-509319212):3) 03-01 23:57:25.672: E/AuthPII(21374): at ley.l(:com.google.android.gms@[email protected] (190400-509319212):47) 03-01 23:57:25.672: E/AuthPII(21374): at lea.a(:com.google.android.gms@[email protected] (190400-509319212):24) 03-01 23:57:25.672: E/AuthPII(21374): at lef.a(:com.google.android.gms@[email protected] (190400-509319212):2) 03-01 23:57:25.672: E/AuthPII(21374): at lhg.b(:com.google.android.gms@[email protected] (190400-509319212):3) 03-01 23:57:25.672: E/AuthPII(21374): at lhg.a(:com.google.android.gms@[email protected] (190400-509319212):7) 03-01 23:57:25.672: E/AuthPII(21374): at ldh.hasFeatures(:com.google.android.gms@[email protected] (190400-509319212):2) 03-01 23:57:25.672: E/AuthPII(21374): at android.accounts.AbstractAccountAuthenticator$Transport.hasFeatures(AbstractAccountAuthenticator.java:312) 03-01 23:57:25.672: E/AuthPII(21374): at android.accounts.IAccountAuthenticator$Stub.onTransact(IAccountAuthenticator.java:345) 03-01 23:57:25.672: E/AuthPII(21374): at android.os.Binder.transact(Binder.java:1064) 03-01 23:57:25.672: E/AuthPII(21374): at arzy.onTransact(:com.google.android.gms@[email protected] (190400-509319212):1) 03-01 23:57:25.672: E/AuthPII(21374): at android.os.Binder.transact(Binder.java:1064) 03-01 23:57:25.672: E/AuthPII(21374): at amdf.onTransact(:com.google.android.gms@[email protected] (190400-509319212):21) 03-01 23:57:25.672: E/AuthPII(21374): at android.os.Binder.execTransactInternal(Binder.java:1184) 03-01 23:57:25.672: E/AuthPII(21374): at android.os.Binder.execTransact(Binder.java:1143) 03-01 23:57:25.672: E/AuthPII(21374): Message is Long live credential not available. 03-01 23:57:25.672: E/AuthPII(21374): zpc: Long live credential not available. 03-01 23:57:25.672: E/AuthPII(21374): at lgl.a(:com.google.android.gms@[email protected] (190400-509319212):8) 03-01 23:57:25.672: E/AuthPII(21374): at lgs.c(:com.google.android.gms@[email protected] (190400-509319212):3) 03-01 23:57:25.672: E/AuthPII(21374): at ley.l(:com.google.android.gms@[email protected] (190400-509319212):47) 03-01 23:57:25.672: E/AuthPII(21374): at lea.a(:com.google.android.gms@[email protected] (190400-509319212):24) 03-01 23:57:25.672: E/AuthPII(21374): at lef.a(:com.google.android.gms@[email protected] (190400-509319212):2) 03-01 23:57:25.672: E/AuthPII(21374): at lhg.b(:com.google.android.gms@[email protected] (190400-509319212):3) 03-01 23:57:25.672: E/AuthPII(21374): at lhg.a(:com.google.android.gms@[email protected] (190400-509319212):7) 03-01 23:57:25.672: E/AuthPII(21374): at ldh.hasFeatures(:com.google.android.gms@[email protected] (190400-509319212):2) 03-01 23:57:25.672: E/AuthPII(21374): at android.accounts.AbstractAccountAuthenticator$Transport.hasFeatures(AbstractAccountAuthenticator.java:312) 03-01 23:57:25.672: E/AuthPII(21374): at android.accounts.IAccountAuthenticator$Stub.onTransact(IAccountAuthenticator.java:345) 03-01 23:57:25.672: E/AuthPII(21374): at android.os.Binder.transact(Binder.java:1064) 03-01 23:57:25.672: E/AuthPII(21374): at arzy.onTransact(:com.google.android.gms@[email protected] (190400-509319212):1) 03-01 23:57:25.672: E/AuthPII(21374): at android.os.Binder.transact(Binder.java:1064) 03-01 23:57:25.672: E/AuthPII(21374): at amdf.onTransact(:com.google.android.gms@[email protected] (190400-509319212):21) 03-01 23:57:25.672: E/AuthPII(21374): at android.os.Binder.execTransactInternal(Binder.java:1184) 03-01 23:57:25.672: E/AuthPII(21374): at android.os.Binder.execTransact(Binder.java:1143) 03-01 23:57:25.672: W/Auth(21374): [AccountStateSyncher] Unable to look up account state from server: couldn't fetch accessToken [CONTEXT service_id=153 ] 03-01 23:57:25.672: W/Auth(21374): [GaiaServicesFlagManager] Services not available! [CONTEXT service_id=153 ]

and

03-01 23:57:25.346: W/Auth(12016): [GoogleAuthUtil] GoogleAuthUtil 03-01 23:57:25.353: E/Notifications(12016): [ScheduledTaskServiceHandler] Job finished with PERMANENT_FAILURE. Job ID: '2000001001', key: 'RPC_REMOVE_TARGET' 03-01 23:57:25.353: E/Notifications(12016): com.google.android.gms.auth.UserRecoverableAuthException: BadAuthentication 03-01 23:57:25.353: E/Notifications(12016): at com.google.android.gms.auth.m.e(PG:18) 03-01 23:57:25.353: E/Notifications(12016): at com.google.android.gms.auth.g.a(PG:11) 03-01 23:57:25.353: E/Notifications(12016): at com.google.android.gms.auth.m.g(PG:11) 03-01 23:57:25.353: E/Notifications(12016): at com.google.android.gms.auth.m.f(PG:15) 03-01 23:57:25.353: E/Notifications(12016): at com.google.android.gms.auth.m.k(PG:2) 03-01 23:57:25.353: E/Notifications(12016): at com.google.android.gms.auth.m.j(PG:1) 03-01 23:57:25.353: E/Notifications(12016): at com.google.android.gms.auth.f.a(PG:2) 03-01 23:57:25.353: E/Notifications(12016): at com.google.android.libraries.notifications.g.c.a.a.a.b.b(PG:17) 03-01 23:57:25.353: E/Notifications(12016): at com.google.android.libraries.notifications.l.a.b.a(PG:12) 03-01 23:57:25.353: E/Notifications(12016): at com.google.android.libraries.notifications.l.a.a.f(PG:2) 03-01 23:57:25.353: E/Notifications(12016): at com.google.android.libraries.notifications.f.i.a.d.f(PG:29) 03-01 23:57:25.353: E/Notifications(12016): at com.google.android.libraries.notifications.f.j.a.i.a(PG:2) 03-01 23:57:25.353: E/Notifications(12016): at com.google.android.libraries.notifications.f.j.a.j.e(PG:6) 03-01 23:57:25.353: E/Notifications(12016): at com.google.android.libraries.notifications.entrypoints.scheduled.a.run(PG:1) 03-01 23:57:25.353: E/Notifications(12016): at com.google.apps.tiktok.tracing.dn.run(PG:2) 03-01 23:57:25.353: E/Notifications(12016): at com.google.android.libraries.i.ab.run(PG:1) 03-01 23:57:25.353: E/Notifications(12016): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 03-01 23:57:25.353: E/Notifications(12016): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 03-01 23:57:25.353: E/Notifications(12016): at com.google.android.libraries.i.f.run(PG:2) 03-01 23:57:25.353: E/Notifications(12016): at com.google.android.libraries.i.n.run(PG:4) 03-01 23:57:25.353: E/Notifications(12016): at java.lang.Thread.run(Thread.java:920) 03-01 23:57:25.431: D/TileServices(2695): Couldn't find tile for ComponentInfo

Interestingly enough the stack with "not connected" does not appear in logcat, but is listed as the crash reason in the report: Exception java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1502154483, result=-1, data=null} to activity {com.google.android.gms/com.google.android.gms.games.ui.signinflow.SignInActivity}: java.lang.IllegalStateException: Not connected. Call connect() and wait for onConnected() to be called. at android.app.ActivityThread.deliverResults (ActivityThread.java:5301) at android.app.ActivityThread.handleSendResult (ActivityThread.java:5340) at android.app.servertransaction.ActivityResultItem.execute (ActivityResultItem.java:54) at android.app.servertransaction.ActivityTransactionItem.execute (ActivityTransactionItem.java:45) at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2210) at android.os.Handler.dispatchMessage (Handler.java:106) at android.os.Looper.loopOnce (Looper.java:201) at android.os.Looper.loop (Looper.java:288) at android.app.ActivityThread.main (ActivityThread.java:7839) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1003) Caused by java.lang.IllegalStateException: Not connected. Call connect() and wait for onConnected() to be called. at m.ggr.e (:com.google.android.gms.optional_games@[email protected] (100000-0)) at m.hqd.aQ (:com.google.android.gms.optional_games@[email protected] (100000-0):7) at m.hqd.T (:com.google.android.gms.optional_games@[email protected] (100000-0):3) at m.bw.a (:com.google.android.gms.optional_games@[email protected] (100000-0):7) at m.sm.e (:com.google.android.gms.optional_games@[email protected] (100000-0):6) at m.cjf.onActivityResult (:com.google.android.gms.optional_games@[email protected] (100000-0)) at m.cjo.onActivityResult (:com.google.android.gms.optional_games@[email protected] (100000-0)) at hcr.public_onActivityResult (:com.google.android.gms@[email protected] (190400-509319212)) at xtl.onActivityResult (:com.google.android.gms@[email protected] (190400-509319212):4) at android.app.Activity.dispatchActivityResult (Activity.java:8381) at android.app.ActivityThread.deliverResults (ActivityThread.java:5294)

Using the SDK 0.11.01 for Unity.

hrkm avatar Mar 02 '23 08:03 hrkm

I have managed to get rid of the errors displayed by the pre-launch reports on the Play Store internal testing channel by encapsulating the PlayGamesPlatform.Activate(); as well as the PlayGamesPlatform.Instance.Authenticate(OnSignInResult); instructions inside a try / catch and moving it from the Start function to a co-routine with a few small delays to give the system time to perform the actual login. I am not sure the co-routine part is 100% necessary but that is exactly how I did it. You know what they say, if it works, don't fix it :))

0 crashes now, at least in the pre-launch report. We will see if it still crashes in production (hopefully not). I also made sure to add the code for this in my first scene ( before the code was not in the first scene of the game, though the first scene only took 1-2 seconds to display as it was a loading screen). Here is the code I used. Hope this works for you as well @hrkm and @ArnaudDroxler ! This issue has already consumed many weeks of work and tests to get rid of. I still think this is something that the people making this plugin should fix, but hopefully this workaround will solve our issues for now.

My Code :

public void Start() { StartCoroutine(XStartRoutine());
} IEnumerator XStartRoutine() { yield return new WaitForSeconds(0.3f); try { PlayGamesPlatform.DebugLogEnabled = false; PlayGamesPlatform.Activate(); } catch { Debug.Log("login error");
} yield return new WaitForSeconds(0.5f); try { PlayGamesPlatform.Instance.Authenticate(OnSignInResult); } catch { Debug.Log("login error");
} } private void OnSignInResult(SignInStatus signInStatus) { if (signInStatus == SignInStatus.Success) {
XPlayerLoggedInSuccessfully();
} else if (signInStatus == SignInStatus.Canceled || signInStatus == SignInStatus.InternalError) {
Debug.Log("OnSignInResult had an error");
}
}

TheLonelyDeveloper avatar Mar 03 '23 15:03 TheLonelyDeveloper