playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.45k stars 963 forks source link

Achievements not unlocking at all #3187

Closed rico345100 closed 1 year ago

rico345100 commented 2 years ago

Describe the bug There was a huge issue a few months ago while integrating with Firebase. The authentication always failed, and all the features were broken.

Somehow I fixed the authentication by adding an app signing certificate in Google Cloud OAuth, but the achievement system is still broken and not coming back.

There are two types of this issue. The first issue is just not working at all. I added achievement in the last update, and it's already been two months, but no man who achieved it. Many of my players already satisfied the condition, but no one achieved it in my Google Play Console.

The second issue is that they consistently watch the same unlocking achievement popup every time they play it. Afaik, if the user already achieved the achievement, it should be just ignored. It was, but after the firebase incident, it's broken.

Whether it's the first or the second case, the new achievement has not been cleared at all, so it's clear that it's completely broken in my case.

To Reproduce There's no step for reproducing. Firebase messed up everything. All I want is just back to normal.

Expected behavior Achievements should be unlocked, and the already unlocked one shouldn't bother the player.

Observed behavior A clear and concise description of what you observed.

Versions

rico345100 commented 2 years ago

HELLO

rico345100 commented 2 years ago

IDK this helps, but I found this stuff in Google Cloud. AchievementBroken

Saved Games works, but achievement and leaderboard are just broken. What should I check?

rico345100 commented 2 years ago

I've also found this on the logcat.

09-11 20:45:25.873: W/AppOps(3674): Bad call: specified package com.google.android.play.games under uid 10682 but it is really 10208
09-11 20:45:25.873: W/AppOps(3674): java.lang.RuntimeException: here
09-11 20:45:25.873: W/AppOps(3674):     at com.android.server.AppOpsService.getOpsRawLocked(AppOpsService.java:1402)
09-11 20:45:25.873: W/AppOps(3674):     at com.android.server.AppOpsService.checkPackage(AppOpsService.java:1106)
09-11 20:45:25.873: W/AppOps(3674):     at com.android.internal.app.IAppOpsService$Stub.onTransact(IAppOpsService.java:169)
09-11 20:45:25.873: W/AppOps(3674):     at android.os.Binder.execTransact(Binder.java:682)
09-11 20:45:25.963: I/Unity(27891):  [Play Games Plugin 0.10.14] 09/11/22 20:45:25 +09:00 DEBUG: Progress 100 interpreted as UNLOCK.
rico345100 commented 2 years ago

Someone?

rico345100 commented 1 year ago

Hello.

rico345100 commented 1 year ago

Hello.

rico345100 commented 1 year ago

FIX THIS SHIT.

rico345100 commented 1 year ago

FIX. THIS.

rico345100 commented 1 year ago

Fix this shit right now, or at least give me something to try, god damn it.

rico345100 commented 1 year ago

Fix this.

olehkuznetsov commented 1 year ago

can you share you game package name and steps how to unlock any achievement, please?

rico345100 commented 1 year ago

@olehkuznetsov Package name is me.modernator.stickWarfareBloodStrike

Here's the code for unlocking achievement:

public static void Unlock(Achievement achievement, AchivementCallback onSuccess = null, AchivementCallback onFailed = null) {
    // CURRENTLY GOOGLE PLAY GAMES ARE BROKEN, AND ACHIEVEMENT SYSTEM DOES NOT WORK, SO DISABLE IT FOR A MOMENT UNTIL IT'S FIXED.
    if (onFailed != null) {
        onFailed();
    }
    return;

    if (Social.localUser.authenticated == false) return;

    if (onSuccess == null) {
        onSuccess = EmptyDelegate;
    }
    if (onFailed == null) {
        onFailed = EmptyDelegate;
    }

    string achievementId = GetAchievementId(achievement);

    if (string.IsNullOrEmpty(achievementId)) {
        return;
    }

    Social.ReportProgress(achievementId, 100, (success) => {
        if(success) {
            onSuccess();
        }
        else {
            onFailed();
        }
    });

    ApplicationEventManager.OnAchievementUnlocked.Invoke(achievement.ToString());
}

I'm not sure what kind of steps you are asking, I just followed everything in the documentation. As I mentioned at the beginning, it worked before but after fixing firebase related issue, now it doesn't work anymore.

The only thing I can guess is that FB authentication caused this whole mess but I don't know how fix this, IDK how GPGS system works internally so there's nothing I can try.

olehkuznetsov commented 1 year ago

Can you verify, please Play developer console -> Play Games Services -> Credentials

You need to have credentials pair for your package name and correct SHA1.

Seems as if you have the correct pair in the Cloud console if players can sign-in. But if you miss it in the Play developer console then some API will not work.

rico345100 commented 1 year ago

Can you verify, please Play developer console -> Play Games Services -> Credentials You need to have credentials pair for your package name and correct SHA1. Seems as if you have the correct pair in the Cloud console if players can sign-in. But if you miss it in the Play developer console then some API will not work.

Same package name, correct SHA-1.

olehkuznetsov commented 1 year ago

In your configuration you have only one Android pair added. Usually developers have at least debug and release SHA1 keys there.

Do you have just one pair in Cloud console as well?

Also I've noticed you are requesting email and profile information for PGS sign-in. Do you need it? This request blocks automatic sign-in.

olehkuznetsov commented 1 year ago

You have two Auth records for Android in Cloud console. Second one was added at the end of Jun. Can it be connected with your Firebase change? Can you add that second credentials to Play console please?

rico345100 commented 1 year ago

In your configuration you have only one Android pair added. Usually developers have at least debug and release SHA1 keys there.

Before FB messed up, there was only one android OAuth client ID and it worked without any problem. But after the incident, all GPGS features went nuts, even authentication and saved games didn't work.

So I made a new android OAuth client ID and entered the app signing key SHA-1 and it started to work back, but since then the leaderboard system and achievement system started to not worked completely.

Also I've noticed you are requesting email and profile information for PGS sign-in. Do you need it? This request blocks automatic sign-in.

Yes, I need it. It doesn't matter whether automatic sign-in works or not in my game, the users never complain about that. They can refuse to sign in if they don't want to.

Authentication and Saved Games features are working without any problem.

rico345100 commented 1 year ago

You have two Auth records for Android in Cloud console. Second one was added at the end of Jun.

Yes, the second oauth ID was generated when FB messed up, and it fixed the authentication and Saved Game problems. All features were worked with the first android oauth ID before FB mess. I don't know how GPGS authentication works so I just leave them all because I don't want to risk.

Can it be connected with your Firebase change?

What does that mean?

Can you add that second credentials to Play console please?

How to do that? I can't find that in Google Play console.

olehkuznetsov commented 1 year ago

https://play.google.com/console/ Play developer console -> Play Games Services -> Credentials

There will be an option to add new credentials. You need to add the same credentials as you have added in Cloud console.

rico345100 commented 1 year ago

https://play.google.com/console/ Play developer console -> Play Games Services -> Credentials

There will be an option to add new credentials. You need to add the same credentials as you have added in Cloud console.

Added and tested, but still achievement system didn't work.

olehkuznetsov commented 1 year ago

Have you published those changes? By default any changes to "Play developer console -> Play Games Services" are in draft mode. Check page "Play developer console -> Play Games Services -> Publishing" if there are any unpublished changes, please.

rico345100 commented 1 year ago

Have you published those changes? By default any changes to "Play developer console -> Play Games Services" are in draft mode. Check page "Play developer console -> Play Games Services -> Publishing" if there are any unpublished changes, please.

Yes, I already published it several hours ago.

olehkuznetsov commented 1 year ago

Can you check again if it is fixed, please?