Play-games-plugin-for-unity: Stuck on Authenticate

Created on 14 Jul 2016  路  9Comments  路  Source: playgameservices/play-games-plugin-for-unity

I'm using Unity 5.3.5p7 and GooglePlayGamesPlugin-0.9.34. I've gotten the GPG Plugin to work in the past, but for my latest game I'm encountering an issue trying to get the game to authenticate and display the login UI. I have already updated all of the necessary files in the Android SDK but still no luck. The log displays the following when I attempt to initiate the service:

07-13 22:35:01.623: D/GamesUnitySDK(26262): Performing Android initialization of the GPG SDK
07-13 22:35:01.633: I/art(26262): Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.games.multiplayer.ParticipantResult>
07-13 22:35:01.633: I/art(26262): Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.games.multiplayer.ParticipantResult>
07-13 22:35:01.634: E/GamesNativeSDK(26262): Can't register class com/google/android/gms/games/multiplayer/ParticipantResult: an exception occurred.
07-13 22:35:01.639: I/art(26262): Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.nearby.connection.AppIdentifier>
07-13 22:35:01.639: I/art(26262): Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.nearby.connection.AppIdentifier>
07-13 22:35:01.639: E/GamesNativeSDK(26262): Can't register class com/google/android/gms/nearby/connection/AppIdentifier: an exception occurred.
07-13 22:35:01.640: I/art(26262): Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.nearby.connection.AppMetadata>
07-13 22:35:01.640: I/art(26262): Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.nearby.connection.AppMetadata>
07-13 22:35:01.640: E/GamesNativeSDK(26262): Can't register class com/google/android/gms/nearby/connection/AppMetadata: an exception occurred.
07-13 22:35:01.703: I/Unity(26262): Building GPG services, implicitly attempts silent auth
07-13 22:35:01.703: I/Unity(26262):  
07-13 22:35:01.703: I/Unity(26262): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
07-13 22:35:01.705: E/GamesNativeSDK(26262): Could not register one or more required Java classes.
07-13 22:35:01.775: I/Unity(26262): InvalidOperationException: There was an error creating a GameServices object. Check for log errors from GamesNativeSDK
07-13 22:35:01.775: I/Unity(26262):   at GooglePlayGames.Native.PInvoke.GameServicesBuilder.Build (GooglePlayGames.Native.PInvoke.PlatformConfiguration configRef) [0x00000] in <filename unknown>:0 
07-13 22:35:01.775: I/Unity(26262):   at GooglePlayGames.Native.NativeClient.InitializeGameServices () [0x00000] in <filename unknown>:0 
07-13 22:35:01.775: I/Unity(26262):   at GooglePlayGames.Native.NativeClient.Authenticate (System.Action`1 callback, Boolean silent) [0x00000] in <filename unknown>:0 
07-13 22:35:01.775: I/Unity(26262):   at GooglePlayGames.PlayGamesPlatform.Authenticate (System.Action`1 callback, Boolean silent) [0x00000] in <filename unknown>:0 
07-13 22:35:01.775: I/Unity(26262):   at GooglePlayGames.PlayGamesPlatform.Authenticate (System.Action`1 callback) [0x00000] in <filename unknown>:0 
07-13 22:35:01.775: I/Unity(26262):   at GooglePlayGames.PlayGamesLocalUser.Authenticate (System.Action`1 callback) [0x00000] in <filename unknown>:0 
07-13 22:35:01.775: I/Unity(26262):   at GooglePlayFunctions.LogIn () [0x00000] in <filename unknown>:0 
07-13 22:35:01.775: I/Unity(26262):   at GooglePlayFunctions.SignOut () [0x00000] in <filename unknown>:0 
07-13 22:35:01.775: I/Unity(26262):   at Unit

I also receive the following messages repeatedly in the console:

screen shot 2016-07-13 at 11 50 16 pm

Any help is greatly appreciated!

Most helpful comment

I have the same problem than @justinkmai.
Some aar are 8.4.0 and other 9.2.1.
I have removed , reimported and setup GPG 9.34 again.... but it keeps loading 8.4.0.
The crazy thing is that in other of my projects it loads 9.2.1 perfectly.... 驴?驴?... I don't understand why.

EDIT:
I've found a solution:
-Delete GPG folders.
-Delete Plugins/Android and Plugins/IOS folders.
-Restart Unity (the aar files appears again... delete them).
-Restart Unity (the aar files will not appear).
-Close Unity.
It seems we have removed the plugin completely but there're still 3 files:
-The trick: Go to \ProjectSettings and delete the files:
GoogleDependencyGooglePlayGames.xml
GoogleDependencyGoogle.GPG.xml
GooglePlayGameSettings.txt

Maybe deleting those 3 files is the only necessary step.

Now the plugin loads v.9.2.1.
It worked for me :-)

All 9 comments

Having the exact same issue here.
Sadly, I haven't had any luck so far.

Edit: While not a fix, reverting back to an older version worked (version 0.9.27).

The errors related to not finding classes means the play-services aar fles where not added correctly to the Unity project. I imagine that when you reverted to an older version, the aar files were then added correctly and all worked.

@justinkmai - can you share the contents of Assets/Plugins/Android?

Hey @claywilkinson, I'm not home at the moment, but I can list from what I can see in my dropbox folder:

Folder - libs
Folder - MainLibProj
appcompat-v7-23.1.1.aar
play-services-base-8.4.0.aar
play-services-basement-8.4.0.aar
play-services-drive-8.4.0.aar
play-services-games-9.2.1.aar
play-services-nearby-9.2.1.aar
play-services-plus-8.4.0,aar
support-annotations-23.4.0.jar
support-v4-23.1.1.aar

You have a mixture of 8.4 and 9.2.1 - can you delete the 8.4.0 files and rerun setup? It should add the 9.2.1 versions of the aar files needed.

Will try that as soon as I get home tonight! I'll let you know if there are any further issues. Thanks Clay!

Hey @claywilkinson, I have just tried deleting the 8.4.0 files within my Unity project, however they immediately get added back in. I also get the following messages in the console:

screen shot 2016-07-21 at 9 12 48 pm

The files return to the same version as well:

screen shot 2016-07-21 at 9 15 42 pm

EDIT: I just rolled back to GPG version 9.33 and it worked. The UI didn't appear, but it was able to log me in. All the GPG files were version 8.4.0. So it seems that for some reason in GPG 9.34 that some of the files aren't updating to 9.2.1.

Authentication is not working here as well. I tried before, downgraded Google Play Services plugin, didn't worked again. Now I got back to the newest version and not even the Google Play Games window is being displayed.

I have the same problem than @justinkmai.
Some aar are 8.4.0 and other 9.2.1.
I have removed , reimported and setup GPG 9.34 again.... but it keeps loading 8.4.0.
The crazy thing is that in other of my projects it loads 9.2.1 perfectly.... 驴?驴?... I don't understand why.

EDIT:
I've found a solution:
-Delete GPG folders.
-Delete Plugins/Android and Plugins/IOS folders.
-Restart Unity (the aar files appears again... delete them).
-Restart Unity (the aar files will not appear).
-Close Unity.
It seems we have removed the plugin completely but there're still 3 files:
-The trick: Go to \ProjectSettings and delete the files:
GoogleDependencyGooglePlayGames.xml
GoogleDependencyGoogle.GPG.xml
GooglePlayGameSettings.txt

Maybe deleting those 3 files is the only necessary step.

Now the plugin loads v.9.2.1.
It worked for me :-)

@ffff1111 you're a genius! It worked! And you're right.. I only had to delete those three files in order for it to load v9.2.1. Thanks a lot! :)

Was this page helpful?
0 / 5 - 0 ratings