Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Playservices not working

Discussion in 'Android' started by samrat2825, Jul 7, 2019.

  1. samrat2825

    samrat2825

    Joined:
    May 3, 2019
    Posts:
    4
    This is the script of my google play services. But when I install the game from play store functions like login and all doesn't work. Can anyone help me with this?


    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using GooglePlayGames;
    5. using GooglePlayGames.BasicApi;
    6. using UnityEngine.SocialPlatforms;
    7. public class playconsole : MonoBehaviour
    8. {
    9.     public static playconsole play;
    10.     void Awake()
    11.     {
    12.         play = this;
    13.         DontDestroyOnLoad(gameObject);
    14.     }
    15.     private void Start()
    16.     {
    17.         PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
    18.        
    19.         .EnableSavedGames()
    20.        
    21.         .RequestEmail()
    22.    
    23.         .RequestServerAuthCode(false)
    24.      
    25.         .RequestIdToken()      
    26.         .Build();
    27.         PlayGamesPlatform.InitializeInstance(config);
    28.         // recommended for debugging:
    29.         PlayGamesPlatform.DebugLogEnabled = true;
    30.         // Activate the Google Play Games platform
    31.         PlayGamesPlatform.Activate();
    32.         SignIn();
    33.     }
    34.     private void SignIn()
    35.     {
    36.         Social.localUser.Authenticate( (bool success) =>
    37.         {
    38.            if(success)
    39.             {
    40.                 Debug.Log("Signed into Google Play Services");
    41.             }
    42.             else
    43.             {
    44.                 Debug.Log("Unable to sign into Google Play Services");
    45.             }
    46.         });
    47.     }
    48.     #region Achievements
    49.     public void UnlockAchievement(string Id)
    50.     {
    51.         Social.ReportProgress(Id, 30.0f, (bool success) => {
    52.         });
    53.         Social.ReportProgress(Id, 60.0f, (bool success) => {
    54.         });
    55.         Social.ReportProgress(Id, 90.0f, (bool success) => {
    56.         });
    57.     }
    58.     public void ShowAchievements()
    59.     {
    60.         Social.ShowAchievementsUI();
    61.     }
    62.     #endregion
    63.    
    64.     #region Leaderboard
    65.     public void AddScoreTotheLeaderboard(long score, string leaderboardId)
    66.     {
    67.         Social.ReportScore(score, leaderboardId, (bool success) =>
    68.         {
    69.         });
    70.     }
    71.     public void ShowLeaderboard()
    72.     {
    73.         Social.ShowLeaderboardUI();
    74.     }
    75.     #endregion
    76.    
    77. }
     
    Last edited: Jul 28, 2019
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please show the results of your Debug.Log statements, they will show in the device logs. Feel free to add additional debug statements. And please use code tags.
     
  3. samrat2825

    samrat2825

    Joined:
    May 3, 2019
    Posts:
    4
    START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.empire.cubeFall/com.unity3d.player.UnityPlayerActivity bnds=[540,426][786,716]} from uid 10027 and from pid 2942
    07-16 15:41:23.905 2236 2318 I ActivityManager: Start proc 16838:com.empire.cubeFall/u0a214 for activity com.empire.cubeFall/com.unity3d.player.UnityPlayerActivity
    07-16 15:41:23.942 2236 3761 D ActivityManager: zjm TOP_APP is ProcessRecord{3061bfe 16838:com.empire.cubeFall/u0a214} uid is 10214
    07-16 15:41:24.384 2236 2344 I ActivityManager: Displayed com.empire.cubeFall/com.unity3d.player.UnityPlayerActivity: +500ms
    07-16 15:41:24.479 16838 16857 I Unity : SystemInfo CPU = ARMv7 VFPv3 NEON, Cores = 8, Memory = 3711mb
    07-16 15:41:24.479 16838 16857 I Unity : SystemInfo ARM big.LITTLE configuration: 4 big (mask: 0xf0), 4 little (mask: 0xf)
    07-16 15:41:24.480 16838 16857 I Unity : ApplicationInfo com.empire.cubeFall version 3.1 build 22ff49dc-a390-4d79-ae07-5eb820fa3521
    07-16 15:41:24.480 16838 16857 I Unity : Built from '2018.4/staging' branch, Version '2018.4.1f1 (b7c424a951c0)', Build type 'Release', Scripting Backend 'mono', CPU 'armeabi-v7a'
    07-16 15:41:24.773 16838 16857 D Unity : GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_vertex_half_float GL_OES_framebuffer_object GL_OES_rgb8_rgba8 GL_OES_compressed_ETC1_RGB8_texture GL_AMD_compressed_ATC_texture GL_KHR_texture_compression_astc_ldr GL_KHR_texture_compression_astc_hdr GL_OES_texture_compression_astc GL_OES_texture_npot GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_OES_texture_3D GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_QCOM_alpha_test GL_OES_depth24 GL_OES_packed_depth_stencil GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_EXT_sRGB GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_EXT_texture_type_2_10_10_10_REV GL_EXT_texture_sRGB_decode GL_EXT_texture_format_sRGB_override GL_OES_element_index_uint GL_EXT_copy_image GL_EXT_geometry_shader GL_EXT_tessellation_shader GL_OES_texture_stencil8 GL_EXT_shader_io_blocks GL_OES_shader_image_atomic GL_OES_sample_variables GL_EXT_texture_border_clamp GL_EXT_EGL_i
    07-16 15:41:24.773 16838 16857 D Unity : mage_external_wrap_modes GL_EXT_multisampled_render_to_texture GL_EXT_multisampled_render_to_texture2 GL_OES_shader_multisample_interpolation GL_EXT_texture_cube_map_array GL_EXT_draw_buffers_indexed GL_EXT_gpu_shader5 GL_EXT_robustness GL_EXT_texture_buffer GL_EXT_shader_framebuffer_fetch GL_ARM_shader_framebuffer_fetch_depth_stencil GL_OES_texture_storage_multisample_2d_array GL_OES_sample_shading GL_OES_get_program_binary GL_EXT_debug_label GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_QCOM_tiled_rendering GL_ANDROID_extension_pack_es31a GL_EXT_primitive_bounding_box GL_OES_standard_derivatives GL_OES_vertex_array_object GL_EXT_disjoint_timer_query GL_KHR_debug GL_EXT_YUV_target GL_EXT_sRGB_write_control GL_EXT_texture_norm16 GL_EXT_discard_framebuffer GL_OES_surfaceless_context GL_OVR_multiview GL_OVR_multiview2 GL_EXT_texture_sRGB_R8 GL_KHR_no_error GL_EXT_debug_marker GL_OES_EGL_image_external_essl3 GL_OVR_multiview_multisampled_render_to_texture GL_EXT_buffer_storage GL_EXT
    07-16 15:41:24.773 16838 16857 D Unity : _external_buffer GL_EXT_blit_framebuffer_params GL_EXT_clip_cull_distance GL_EXT_protected_textures GL_EXT_shader_non_constant_global_initializers GL_QCOM_texture_foveated GL_QCOM_shader_framebuffer_fetch_noncoherent GL_EXT_memory_object GL_EXT_memory_object_fd GL_EXT_EGL_image_array GL_NV_shader_noperspective_interpolation GL_KHR_robust_buffer_access_behavior GL_EXT_EGL_image_storage GL_EXT_blend_func_extended GL_EXT_clip_control
    07-16 15:41:28.636 2236 2318 I ActivityManager: Start proc 16911:com.android.chrome:webview_service/u0a85 for service com.android.chrome/org.chromium.android_webview.services.VariationsSeedServer
    07-16 15:41:28.661 2236 2318 I ActivityManager: Start proc 16923:com.android.chrome:sandboxed_process0/u0i35 for webview_service com.empire.cubeFall/org.chromium.content.app.SandboxedProcessService0
    07-16 15:41:29.124 2236 3761 D PackageManager: callerName== com.empire.cubeFall
    07-16 15:41:29.146 2236 3761 D PackageManager: callerName== com.empire.cubeFall
    07-16 15:41:29.154 2236 2261 D PackageManager: callerName== com.empire.cubeFall
    07-16 15:41:29.169 2236 3761 D PackageManager: callerName== com.empire.cubeFall
    07-16 15:41:38.917 16838 16857 E Unity : NullReferenceException: Object reference not set to an instance of an object
    07-16 15:41:38.917 16838 16857 E Unity : at mainMenu.medals () [0x00000] in <filename unknown>:0
    07-16 15:41:38.917 16838 16857 E Unity : at UnityEngine.Events.InvokableCall.Invoke () [0x00000] in <filename unknown>:0
    07-16 15:41:38.917 16838 16857 E Unity : at UnityEngine.Events.UnityEvent.Invoke () [0x00000] in <filename unknown>:0
    07-16 15:41:38.917 16838 16857 E Unity : at UnityEngine.UI.Button.Press () [0x00000] in <filename unknown>:0
    07-16 15:41:38.917 16838 16857 E Unity : at UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) [0x00000] in <filename unknown>:0
    07-16 15:41:38.917 16838 16857 E Unity : at UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00000] in <filename unknown>:0
    07-16 15:41:38.917 16838 16857 E Unity : at UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerClickHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) [0x00000] in <filename unknown>:0
    07-16 15:41:38.917 16838 16857 E Unity : UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    07-16 15:41:38.917 16838 16857 E Unity : UnityEngine.DebugLogHandler:LogException(Exc
    07-16 15:41:43.827 16838 16857 E Unity : NullReferenceException: Object reference not set to an instance of an object
    07-16 15:41:43.827 16838 16857 E Unity : at mainMenu.leaderboard () [0x00000] in <filename unknown>:0
    07-16 15:41:43.827 16838 16857 E Unity : at UnityEngine.Events.InvokableCall.Invoke () [0x00000] in <filename unknown>:0
    07-16 15:41:43.827 16838 16857 E Unity : at UnityEngine.Events.UnityEvent.Invoke () [0x00000] in <filename unknown>:0
    07-16 15:41:43.827 16838 16857 E Unity : at UnityEngine.UI.Button.Press () [0x00000] in <filename unknown>:0
    07-16 15:41:43.827 16838 16857 E Unity : at UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) [0x00000] in <filename unknown>:0
    07-16 15:41:43.827 16838 16857 E Unity : at UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00000] in <filename unknown>:0
    07-16 15:41:43.827 16838 16857 E Unity : at UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerClickHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) [0x00000] in <filename unknown>:0
    07-16 15:41:43.827 16838 16857 E Unity : UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    07-16 15:41:43.827 16838 16857 E Unity : UnityEngine.DebugLogHandler:LogExceptio
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Where are the additional Debug.Log statements in the log? One note, you have a Null Reference Exception that you will want to find, again using Debug.Log. And please review the logs before posting, and only post the relevant portions, thanks. And please update your post with Code Tags https://forum.unity.com/threads/using-code-tags-properly.143875/