Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when calling PlayGamesPlatform.Instance.LoadUsers #3338

Open
Manoloman opened this issue Jan 27, 2025 · 0 comments
Open

Exception when calling PlayGamesPlatform.Instance.LoadUsers #3338

Manoloman opened this issue Jan 27, 2025 · 0 comments
Labels

Comments

@Manoloman
Copy link

The bug:
Calling the method PlayGamesPlatform.Instance.LoadUsers results in a null pointer exception due to some kind of internal problem with the setAvatar method.

To Reproduce:
Steps to reproduce the behavior:

  1. Complete the platform sign-in action.
  2. Call PlayGamesPlatform.Instance.LoadScores to get a list of IScores containing the users userId.
  3. Call PlayGamesPlatform.Instance.LoadUsers with the array of userIds to retrieve username and avatar
    *Same error calling LoadUsers with the localplayer userId.

Expected behavior:
An array of IUserProfile that would include the usernames and avatars used in the learderboards by these users should be obtained.

Observed behavior:
The call throws an exception with this message:

01-27 17:51:09.003 26583 26583 E Unity : NullReferenceException: Object reference not set to an instance of an object.
01-27 17:51:09.003 26583 26583 E Unity : at GooglePlayGames.PlayGamesUserProfile.setAvatarUrl (System.String avatarUrl) [0x00000] in <00000000000000000000000000000000>:0
01-27 17:51:09.003 26583 26583 E Unity : at GooglePlayGames.PlayGamesUserProfile..ctor (System.String displayName, System.String playerId, System.String avatarUrl) [0x00000] in <00000000000000000000000000000000>:0
01-27 17:51:09.003 26583 26583 E Unity : at GooglePlayGames.Android.AndroidJavaConverter.ToPlayer (UnityEngine.AndroidJavaObject player) [0x00000] in <00000000000000000000000000000000>:0
01-27 17:51:09.003 26583 26583 E Unity : at GooglePlayGames.Android.AndroidClient+<>c__DisplayClass44_0.b__0 (UnityEngine.AndroidJavaObject annotatedData) [0x00000] in <00000000000000000000000000000000>:0
01-27 17:51:09.003 26583 26583 E Unity : at GooglePlayGames.Android.AndroidTaskUtils+TaskOnSuccessProxy`1[T].onSuccess (T result) [0x00000] in <00000000000000000000000000000000>:0
01-27 17:51:09.003 26583 26583 E Unity : at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] paramete

Bug Report:
https://drive.google.com/drive/folders/1lQcCmoWjnozv02n4g0s36t1AxlYORpAZ?usp=sharing (private access)

Versions:

  • Unity version: 2021.3.45f1 (same issue in 2021.3.15f1)
  • Google Play Games Plugin for Unity version: 2.0.0

Additional context:
I'm able to send score to the leaderboards, achievements etc. so the signin is correct. I saw some users creating custom leaderboards retrieving the information using this same LoadUsers method.
I tried applying LoadUsers in the own local user userid too with the same result.

@Manoloman Manoloman added the bug label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant