playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.46k stars 964 forks source link

Inconsistent library state after first ShowSelectSavedGameUI error. #3056

Open karliss opened 3 years ago

karliss commented 3 years ago

I am getting AndroidJavaException: java.lang.NullPointerException: GoogleSignInAccount must not be null in a following situation.

1) successful login, the builtin user name and profile image popup gets automatically displayed 2) call ShowSelectSavedGameUI -> fails with ShowSelectSnapshotUI failed with exception due to save game feature being enabled less than 24 hours ago. The result callback with error gets properly called and can be handled by game. This is somewhat fine and more or less matches documentation. 3) At this point Social.Active.localUser.authenticated and ((PlayGamesPlatform)Social.Active).IsAuthenticated() still report true 4) calling call ShowSelectSavedGameUI second time causes exception mentioned bellow and the result callback for ShowSelectSavedGameUI is never called.

Full stacktrace:

08-16 14:09:38.129: E/Unity(24343): AndroidJavaException: java.lang.NullPointerException: GoogleSignInAccount must not be null
08-16 14:09:38.129: E/Unity(24343): java.lang.NullPointerException: GoogleSignInAccount must not be null
08-16 14:09:38.129: E/Unity(24343):     at com.google.android.gms.common.internal.Preconditions.checkNotNull(com.google.android.gms:play-services-basement@@17.4.0:11)
08-16 14:09:38.129: E/Unity(24343):     at com.google.android.gms.games.Games.getSnapshotsClient(com.google.android.gms:play-services-games@@21.0.0:69)
08-16 14:09:38.129: E/Unity(24343):     at com.google.games.bridge.SelectSnapshotUiRequest.process(SelectSnapshotUiRequest.java:65)
08-16 14:09:38.129: E/Unity(24343):     at com.google.games.bridge.HelperFragment.processRequest(HelperFragment.java:299)
08-16 14:09:38.129: E/Unity(24343):     at com.google.games.bridge.HelperFragment.startRequest(HelperFragment.java:257)
08-16 14:09:38.129: E/Unity(24343):     at com.google.games.bridge.HelperFragment.showSelectSnapshotUi(HelperFragment.java:155)
08-16 14:09:38.129: E/Unity(24343):     at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
08-16 14:09:38.129: E/Unity(24343):     at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
08-16 14:09:38.129: E/Unity(24343):     at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
08-16 14:09:38.129: E/Unity(24343):     at android.os.Handler.dispatchMessage(Handler.java:103)
08-16 14:09:38.129: E/Unity(24343):     at android.os.Loope

If I perform sign out and sign in before step 4) the second failure gets reported the same way as first one .