question

Justin avatar image
Justin asked

Using Unity 2018.3 and Google Play Games for Unity 0.9.50 breaks LinkGoogleAccount

I was using Using Unity 2018.2 and (GPG) Google Play Games for Unity 0.9.50.

My signin flow first logs in the device with DeviceId, then trys to LinkGoogleAccount with ForceLink=false. If that fails, due to LinkAlreadyClaimed, it then trys to LinkGoogleAccount with ForceLink=true and using PlayGamesPlatform.Instance.GetAnotherServerAuthCode(true, (authCode) => {....

After each successful authentication I set the preferred type, so after LinkGoogleAccount succeeds once the type becomes LoginWithGoogleAccount with CA=false.

All of that was working good. Then I updated to Unity 2018.3.0f2....

All the sudden LinkGoogleAccount would start to authenicate and the app would hard crash. (I missed the connection for awhile because I had worked on a test project outside of Google signin after updating Unity to 2018.3.0f2. When I tried to implement that test project into the main project, with the LinkGoogleAccount auth flow, I noticed it was broken.)

I discovered my GPG version was very outdated. As of January 4, 2019 the current GPG version is 0.9.57

https://github.com/playgameservices/play-games-plugin-for-unity/blob/master/CHANGELOG.txt

If you are updating GPG first save a backup of your project, then follow the instructions from the GPG GitHub https://github.com/playgameservices/play-games-plugin-for-unity/blob/master/UPGRADING.txt

The most current GPG version .unitypackage file can be found after cloning/downloading from https://github.com/playgameservices/play-games-plugin-for-unity , then look in play-games-plugin-for-unity-master\current-build

After the previous version and folders have been removed per instructions, in Unity go to Assets -> Import Package -> Custom Package and find the "current build" .unitypackage file.

Once Unity has finished, you need to check that Window -> Google Play Games -> Setup -> Android Setup is still correct for your project. If not you need the info from Google Console from the initial GPG setup you did.

I hope this helps someone if they are experiencing strange/broken GPG behavior after Updating Unity.

unity3dsdksAuthenticationandroid
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Andy avatar image
Andy answered

Thanks for the heads-up! Do you by any chance have any logs from the crashes lying around? I'd be interested in the callstack associated with the crash. It would help us identify if there's anything we can harden.

5 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Justin avatar image Justin commented ·

@Andy

I did not save them.. sorry.

I was using Logcat in Android studio to test with a Nexus5 and Nox(emulator).

I could see LinkGoogleAccount being called and a message that TokenAuth was started but then the app went into a loop of messages about loosing something to do with Graphics. I don't think that is pointing to something other than once the hard crash happens on the device a message box appears and says something like "application has been shut down" and an ok button. But Logcat continues to show the device lost connection to a graphics reference. I believe it was trying to access a canvas and got the plug pulled during the access.

OnLinkGoogleSuccess or OnLinkGoogleError callbacks never were called after PlayGamesPlatform.Instance.localUser.Authenticate and PlayStream didn't show an attempt to Link.

0 Likes 0 ·
Justin avatar image Justin commented ·

@Andy

I am still having issues with LinkGoogle. When the PlayGamesPlatform.Instance.localuser.Authenticate((success) => ....

is run the Logcat log and app just stops. The App doesn't crash anymore but it just stops with no error.

I am begining to think maybe Unity 2018.3 has issues with Link google.

0 Likes 0 ·
Justin avatar image Justin commented ·

Here is the Logcat with Unity Filter (just ends.. doesn't crash the app though). I am going to try my Authentication flow only on a fresh project file in 2018.2 an one in 2017LTS to see if it still does it. Link used to work..

0 Likes 0 ·
Andy avatar image Andy ♦♦ Justin commented ·

I'm not seeing anything unexpected in that screenshot. Let me know how things go with the fresh project.

0 Likes 0 ·
Justin avatar image Justin commented ·

@Andy

Update:

After removing all my plugins (including GooglPlayGames) and removing SDKs I reinstalled them and everything is working on 2018.3

In hindsight I probably should have just made a fresh install of 2018.3 and installed everything from scratch. It would have been much quicker than dismantling manually.

I still don't know why the error/crash was happening, but I think there were missing or conflicting files.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.