playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.47k stars 966 forks source link

Initialization/Authentication not working! #315

Closed DeltaAtled closed 9 years ago

DeltaAtled commented 9 years ago

I updated to the 9.10 and the service never worked from there. I had 9.07 and it was working great but since I upgraded to the 9.10 it just didnt work. I'm closing in on finishing my game for the android and I would like to keep the SDK up to date.

The 9.10 release doesnt work properly, it made me go crazy trying to find the reason why it never allowed me to login to my google account during gameplay or allowed me to view the Leaderboards and so on. An hour of fiddling with my code and I realized that it just never initialized as it should to use the google play services. This code" PlayGamesPlatform.Activate();" is to initialize and it never did do that. I reverted to the 9.07 and it worked great, it did initialize with that version. All my code worked properly even my login button for authenticating the user to the google play services. I haven't tracked down what causes the 9.10 not to initialize for the social platform in unity. I am using Unity 4.6 and this could be a reason why the 9.10 is not working properly.

UPDATE


Looks like the "Social" code in Unity is working as it gave me a debug log of the authentication process as a failure.

Social.localUser.Authenticate ((bool success) => { if (success) { Debug.Log ("You've successfully logged in!"); } else { Debug.Log ("Login failed for some reason"); } });

So it looks like it never authenticates the user so all the code for the SDK never works because the user never gets a successful authentication. This is all from the Editor side, I haven't looked at the debug on the android side of my game.

samtstern commented 9 years ago

Sign-in always fails when you are in the Unity editor. You need to run your application on an Android device with Google Play Services in order to see sign in work.

DeltaAtled commented 9 years ago

I installed the game on my android phone and it didnt work, I could not login in. I had to install the 9.07 version which works fine.

As of now I removed the sdk and reinstalled it fresh with the 9.10. Here is the log from the android device. I ran my game at the start it would initialize the SDK, I click the login button and nothin happens so i close the game.

So it looks like it cant find the GPG dll file.

$ adb logcat -s Unity

--------- beginning of /dev/log/system --------- beginning of /dev/log/main D/Unity (11616): GL_EXT_debug_marker GL_OES_rgb8_rgba8 GL_OES_depth24 GL_OES_v ertex_half_float GL_OES_texture_float GL_OES_texture_half_float GL_OES_element_i ndex_uint GL_OES_mapbuffer GL_OES_fragment_precision_high GL_OES_compressed_ETC1 _RGB8_texture GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_required_interna lformat GL_OES_depth_texture GL_OES_get_program_binary GL_OES_packed_depth_stenc il GL_OES_standard_derivatives GL_OES_vertex_array_object GL_OES_egl_sync GL_OES _texture_npot GL_EXT_multi_draw_arrays GL_EXT_texture_format_BGRA8888 GL_EXT_dis card_framebuffer GL_EXT_shader_texture_lod GL_IMG_shader_binary GL_IMG_texture_c ompression_pvrtc GL_IMG_texture_compression_pvrtc2 GL_IMG_texture_npot GL_IMG_te xture_format_BGRA8888 GL_IMG_read_format GL_IMG_program_binary GL_IMG_uniform_bu ffer_object GL_IMG_multisampled_render_to_texture I/Unity (11616): Using SDK 6.0.0, Build 140805.da738911cf62c00 I/Unity (11616): I/Unity (11616): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDeb ug.cpp Line: 49) I/Unity (11616): E/Unity (11616): Unable to find gpg E/Unity (11616): Unable to find gpg I/Unity (11616): DllNotFoundException: gpg I/Unity (11616): at (wrapper managed-to-native) GooglePlayGames.Native.Cwrap per.Builder:GameServices_Builder_Construct () I/Unity (11616): at GooglePlayGames.Native.PInvoke.GameServicesBuilder.Creat e () [0x00000] in :0 I/Unity (11616): at GooglePlayGames.Native.NativeClient.InitializeGameServic es () [0x00000] in :0 I/Unity (11616): at GooglePlayGames.Native.NativeClient.Authenticate (System .Action1 callback, Boolean silent) [0x00000] in <filename unknown>:0 I/Unity (11616): at GooglePlayGames.PlayGamesPlatform.Authenticate (System.A ction1 callback, Boolean silent) [0x00000] in :0 I/Unity (11616): at GooglePlayGames.PlayGamesPlatform.Authenticate (System.A ction1 callback) [0x00000] in <filename unknown>:0 I/Unity (11616): at GooglePlayGames.PlayGamesLocalUser.Authenticate (System. Action1 callback) [0x00000] in :0 I/Unity (11616): at menu.googleLoginButton () [0x00000] in <filename unknown

:0 I/Unity (11616): at UnityEngine.Events.InvokableCall.Invoke (System.Object[] args) [0x00000] in :0 I/Unity (11616): at UnityEngine.Events.Inv

DeltaAtled commented 9 years ago

Well I don't have to worry about this anymore. The 9.11 is working great, it authenticated and everything.