sjc / godot-game-services

Godot native plugins for iOS Game Center and Android Google Play Game Services
MIT License
11 stars 3 forks source link

Unexpected behavior and possible failures in Google Services on some models of Android devices #5

Open mmicoe opened 1 month ago

mmicoe commented 1 month ago

Crash occurs only on some models of Android devices: [samsung a14x (Galaxy A14 5G)]

Issue: uk.co.jaml.gameservices.GameServices.lambda$checkAuthenticated$0$uk-co-jaml-gameservices-GameServices com.google.android.gms.tasks.RuntimeExecutionException

Crash details (Google Play Console) Possible solutions (SDK vendor note): The play-services-games-v2 provider (com.google.android.gms:play-services-games-v2) added this note on Oct 13, 2023: "Caused by an incorrect integration: Calling Task#getResult() without first checking if the task succeeded using Task#isSuccessful() can lead to unexpected behavior and possible crashes. This is because getResult() will throw an exception if the task fails. To avoid this issue, always check the task status using isSuccessful() before calling getResult(). If the task succeeds, you can safely retrieve the result using getResult(). Otherwise, handle the error appropriately using getException()."

Type:

com.google.android.gms.tasks.RuntimeExecutionException
Exception com.google.android.gms.tasks.RuntimeExecutionException: com.google.android.gms.common.api.ApiException: 4: The user must be signed in to make this API call.
  at com.google.android.gms.tasks.zzw.getResult (com.google.android.gms:play-services-tasks@@18.1.0:3)
  at uk.co.jaml.gameservices.GameServices.lambda$checkAuthenticated$0$uk-co-jaml-gameservices-GameServices (GameServices.java:179)
  at uk.co.jaml.gameservices.GameServices$$ExternalSyntheticLambda1.onComplete
  at com.google.android.gms.tasks.zzi.run (com.google.android.gms:play-services-tasks@@18.1.0:1)
  at android.os.Handler.handleCallback (Handler.java:958)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loopOnce (Looper.java:230)
  at android.os.Looper.loop (Looper.java:319)
  at android.app.ActivityThread.main (ActivityThread.java:8893)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:608)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1103)
Caused by com.google.android.gms.common.api.ApiException: 4: The user must be signed in to make this API call.
  at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus (com.google.android.gms:play-services-base@@18.4.0:3)
  at com.google.android.gms.common.api.internal.ApiExceptionMapper.getException (com.google.android.gms:play-services-base@@18.4.0:1)
  at com.google.android.gms.common.api.internal.zag.zad (com.google.android.gms:play-services-base@@18.4.0:1)
  at com.google.android.gms.common.api.internal.zabq.zaF (com.google.android.gms:play-services-base@@18.4.0:7)
  at com.google.android.gms.common.api.internal.zabq.zaE (com.google.android.gms:play-services-base@@18.4.0:2)
  at com.google.android.gms.common.api.internal.zabq.zar (com.google.android.gms:play-services-base@@18.4.0:11)
  at com.google.android.gms.common.api.internal.zabq.onConnectionFailed (com.google.android.gms:play-services-base@@18.4.0:1)
  at com.google.android.gms.common.internal.zai.onConnectionFailed (com.google.android.gms:play-services-base@@18.4.0:1)
  at com.google.android.gms.common.internal.zzf.zzb (com.google.android.gms:play-services-basement@@18.3.0:2)
  at com.google.android.gms.common.internal.zza.zza (com.google.android.gms:play-services-basement@@18.3.0:6)
  at com.google.android.gms.common.internal.zzc.zze (com.google.android.gms:play-services-basement@@18.3.0:3)
  at com.google.android.gms.common.internal.zzb.handleMessage (com.google.android.gms:play-services-basement@@18.3.0:31)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loopOnce (Looper.java:230)
  at android.os.Looper.loop (Looper.java:319)
  at android.os.HandlerThread.run (HandlerThread.java:67)

This is not a critical error and only occurs on some device models. I hope this information is helpful. All the best!

sjc commented 1 week ago

isSuccessful() is already being called (see the implementation).

I'll see if there's something else which can be done.

mmicoe commented 1 week ago

Good morning Stuart, don't worry too much. It seems that the error occurs on certain models of Android devices, and these are very specific models.

at uk.co.jaml.gameservices.GameServices.lambda$checkAuthenticated$0$uk-co-jaml-gameservices-GameServices (GameServices.java:179)

I attach you my Issues Google Play Console and screenshots devices.

All the best. Mauro

El vie, 22 nov 2024 a las 7:22, Stuart Crook @.***>) escribió:

isSuccessful() is already being called (see the implementation https://github.com/sjc/godot-game-services/blob/main/android-play-game-services/gameservices/src/main/java/uk/co/jaml/gameservices/GameServices.java ).

I'll see if there's something else which can be done.

— Reply to this email directly, view it on GitHub https://github.com/sjc/godot-game-services/issues/5#issuecomment-2492956188, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQGRGY3VER5J3YKYBWO6VL2B3ERBAVCNFSM6AAAAABPLKF2P2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJSHE2TMMJYHA . You are receiving this because you authored the thread.Message ID: @.***>

-- http://mmegames.com

https://mmegames.com http://mmegames.com @MMeGAMES Este mensaje y cualquier documento que lleve adjunto, es confidencial y destinado únicamente a la persona o entidad a quien ha sido enviado. El carácter confidencial, personal, e intransferible de la misma está protegido legalmente. Cualquier revelación, uso o reenvío no autorizado, total o parcial, está prohibido. Si Usted ha recibido este mensaje por error, le informamos que el contenido en el mismo es reservado y el uso no autorizado está prohibido legalmente, por ello, por favor, ruego lo notifique al e-mail: @.***

sjc commented 1 week ago

Ah. Sorry. I was looking at the wrong line. There's no check on 179, so I can add that in.

sjc commented 1 week ago

I've added the isSuccessful() check. The archive attached contains a new version of the Android plug-in. Obviously there's no way to know whether this has fixed the problem until it's out there an in use on multiple phones, but could you check that the basic functionality still works?

android-gameservices-0.9.1-godot-3.5.1.zip

mmicoe commented 1 week ago

Hi Stuart, of course, I will check the plugin on my games. No problem. I am using Godot 3.6 on all my games and the plugin is compatible.

Thank you!

El sáb, 23 nov 2024, 8:34, Stuart Crook @.***> escribió:

I've added the isSuccessful() check. The archive attached contains a new version of the Android plug-in. Obviously there's no way to know whether this has fixed the problem until it's out there an in use on multiple phones, but could you check that the basic functionality still works?

android-gameservices-0.9.1-godot-3.5.1.zip https://github.com/user-attachments/files/17878906/android-gameservices-0.9.1-godot-3.5.1.zip

— Reply to this email directly, view it on GitHub https://github.com/sjc/godot-game-services/issues/5#issuecomment-2495383482, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQGRG2T57KQJBAR72OREAT2CAVW5AVCNFSM6AAAAABPLKF2P2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJVGM4DGNBYGI . You are receiving this because you authored the thread.Message ID: @.***>

mmicoe commented 6 days ago

I've added the isSuccessful() check. The archive attached contains a new version of the Android plug-in. Obviously there's no way to know whether this has fixed the problem until it's out there an in use on multiple phones, but could you check that the basic functionality still works?

android-gameservices-0.9.1-godot-3.5.1.zip

Hi Stuart, basic functionality works! I've modified the plugin on all my games (Godot 3.6) and they are now in production. I'll keep you posted. It would be interesting if you compiled the plugin for Godot version 3.6 as well.

All the best, Mauro

mmicoe commented 4 days ago

Hi Stuart, I am passing on the following information to you in case you wish to review it. Now I am getting the following new error code: lines GameServices.java: 228 and 224

[OPPO OP56F5 (A17)] [Android 12 (SDK 31)]

android.content.ActivityNotFoundException

Exception android.content.ActivityNotFoundException: at android.app.Instrumentation.checkStartActivityResult (Instrumentation.java:2108) at android.app.Instrumentation.execStartActivity (Instrumentation.java:1768) at android.app.Activity.startActivityForResult (Activity.java:5473) at androidx.activity.ComponentActivity.startActivityForResult (ComponentActivity.java:754) at android.app.Activity.startActivityForResult (Activity.java:5426) at androidx.activity.ComponentActivity.startActivityForResult (ComponentActivity.java:735) at uk.co.jaml.gameservices.GameServices$3.onSuccess (**GameServices.java:228**) at uk.co.jaml.gameservices.GameServices$3.onSuccess (**GameServices.java:224**) at com.google.android.gms.tasks.zzm.run (com.google.android.gms:play-services-tasks@@18.1.0:1) at android.os.Handler.handleCallback (Handler.java:938) at android.os.Handler.dispatchMessage (Handler.java:99) at android.os.Looper.loopOnce (Looper.java:233) at android.os.Looper.loop (Looper.java:344) at android.app.ActivityThread.main (ActivityThread.java:8249) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:589) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1071)

Don't worry too much. If you have time, take a look at it. Note: If you make the correction, I would appreciate it if you compiled the plugin for Godot 3.6 Thank you very much. All the best! Mauro

sjc commented 4 days ago

I think the attached will have fixed that issue.

I'll try and get a 3.6 build but it will take a while to set it up.

android-gameservices-0.9.2-godot-3.5.1.zip