1

GPG service does not work

It shows the native GPG window, but when it’s closed the PlayGamesPlatform.Instance.Authenticate() callback returns NetworkError

In the Google Play Console: Created "Game service”.

  • In the “Game details” section, added a description 512x512 and 1024x500 icons.

  • In the “Linked apps” section, added an android application and completed authentication (OAuth 2.0 key was automatically created)

  • In the “Achievements” section, created an achievement with a description and a 512x512 icon.

  • In the "Testing" section added a gmail account for testing

  • In the “Publishing” section, clicked Publish.

In the Google API:

  • Activated Google Drive API and Google Play Android developer API (without creating any keys)

  • Checked the SHA-1 in the OAuth key for Android and in “Release management”> ”App singing”> ”App signing certificate”

In Unity:

  • Downloaded the latest release from https://github.com/playgameservices/play-games-plugin-for-unity

  • In Window> Google Play games> Setup> Android setup, copied the xml format text from the “Achievements” section of the Google Play Console using the “Get resources” link, the ClientID format is 123456789123456-fffffffffffffffffffffffff.apps.googleusercontent.com

The test build was signed with the same key as the application posted on Google Play with the same Company name and Product Name

PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
.RequestIdToken()
.Build();

PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.Activate();

PlayGamesPlatform.Instance.Authenticate(SignInInteractivity.CanPromptAlways, ((SignInStatus status) =>
{
        if (status == SignInStatus.Success)
        {
            print( $"Welcome {PlayGamesPlatform.Instance.GetUserDisplayName()}\n");
        }
        else
        {
            print($"Fail:{status}");
        }
}));

On debugging in Unty Console I have

<i>AndroidPlayer([email protected]:34999)</i> Returning an error code.
 #0 0x443df5a (libunity.so) GetStacktrace(int) 0x25
 #1 0x4e788b6 (libunity.so) DebugStringToFile(DebugStringToFileData const&) 0x169
 #2 0x49875fe (libunity.so) DebugLogHandler::Internal_Log(LogType, LogOption, core::basic_string<char, core::StringStorageDefault<char> >, Object*) 0x65
 #3 0x498754e (libunity.so) DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*) 0xb5

2 Answers 2

1

I came across this post while trying to find the answer myself and now that I know the answer I thought I would add it in here.... so that I can no doubt discover it the next time I forget how to do this. The issue is caused by the minification as @CherryCoke stated.

The solution can be found here: https://github.com/playgameservices/play-games-plugin-for-unity/blob/master/README.md#decreasing-apk-size

You have two options: either turn off the minification or tell the minify process what to ignore when doing the minification.

If you want to minify your build (which makes sense to me for a release) then you can do so by selecting "Custom Proguard File" in the Publishing Settings area of the Android build in the Player Settings.

enter image description here

Once you have added this in you will need to update the proguard-user.txt file that is specified. The path is displayed under "Custom proguard File".

For google play services then the entries you need to add can be found at: https://github.com/playgameservices/play-games-plugin-for-unity/blob/master/scripts/proguard.txt

0

I just saw this. I had the same error. What I did to fix it was I toned down the bytecode stripping in the project settings. When I checked the unity developer console, I noticed the error stating that my game couldn't find the library for GooglePlayGames.

While this is not the IDEAL answer, it's a temporary fix. The Ideal answer is creating a Link.xml file that tells the compiler not to strip out library .so file. (Which, I am searching for at the moment, and how I came across your question.)

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.