Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by Pias108 · Jul 23, 2014 at 04:01 AM · android

play-games-plugin-for-unity Authentication issue

I have downloaded the google play service form https://github.com/playgameservices/play-games-plugin-for-unity. i have followed the tutorial on github and implemented it. When i click on log in button nothing happened. Here is the code.

 using UnityEngine;
 using System.Collections;
 using GooglePlayGames;
 using UnityEngine.SocialPlatforms;
 
 public class testGPGMenu : MonoBehaviour
 {
 
 public GUISkin skin;
 public int incrementalCount = 5;
 
 //leaderboard strings
 private string leaderboard = "C----------------g";
 //achievement strings
 private string achievement = "C----------------Q";
 private string incremental = "C----------------g";
 
 // Use this for initialization
 void Start()
 {
     PlayGamesPlatform.Activate();
 }
 
 // Update is called once per frame
 public void OnGUI()
 {
     GUI.skin = skin;
     skin.button.fixedWidth = Screen.width - 25;
     skin.textField.fixedWidth = Screen.width - 25;
     GUILayout.BeginArea(new Rect(0, 0, Screen.width, Screen.height));
 
     GUILayout.BeginVertical("box");
 
     GUILayout.Label("Official Google Play Games Services");
 
     GUILayout.Space(20);
 
     //Share Status
     if (GUILayout.Button("Log In"))
     {
         Social.localUser.Authenticate((bool success) =>
                                       {
             if (success)
             {
                 Debug.Log("You've successfully logged in");
             }
             else
             {
                 Debug.Log("Login failed for some reason");
             }
         });
     }
 
     GUILayout.Space(20);
 
     //Achievement
     if (GUILayout.Button("Unlock Achievement"))
     {
         if (Social.localUser.authenticated)
         {
             Social.ReportProgress(achievement, 100.0f, (bool success) =>
                                   {
                 if (success)
                 {
                     Debug.Log("You've successfully logged in");
                 }
                 else
                 {
                     Debug.Log("Login failed for some reason");
                 }
             });
         }
     }
 
     GUILayout.Space(20);
 
     //Incremental Achievement
     if (GUILayout.Button("Press " + incrementalCount + "more times to unlock incremental acheivment"))
     {
         if (Social.localUser.authenticated)
         {
             ((PlayGamesPlatform)Social.Active).IncrementAchievement(incremental, 5, (bool success) =>
                                                                     {
                 //The achievement unlocked successfully
             });
         }
     }
 
     GUILayout.Space(20);
 
     //Leaderboard
     if (GUILayout.Button("Post your 5000 points to the leaderboard"))
     {
         if (Social.localUser.authenticated)
         {
             Social.ReportScore(5000, leaderboard, (bool success) =>
                                {
                 if (success)
                 {
                     ((PlayGamesPlatform)Social.Active).ShowLeaderboardUI(leaderboard);
                 }
                 else
                 {
                     //Debug.Log("Login failed for some reason");
                 }
             });
         }
     }
 
     GUILayout.Space(20);
 
     // Show Leaderboard
     if (GUILayout.Button("Show Leaderboard"))
     {
         Social.ShowLeaderboardUI();
     }
 
     GUILayout.Space(20);
 
     //Show Specific Leaderboard
     if (GUILayout.Button("Show Specific Leaderboard"))
     {
         ((PlayGamesPlatform)Social.Active).ShowLeaderboardUI(leaderboard);
     }
 
     GUILayout.Space(20);
 
     //Show Achievments
     if (GUILayout.Button("Show Achievments"))
     {
         Social.ShowAchievementsUI();
     }
 
     GUILayout.Space(20);
 
     //Sign Out
     if (GUILayout.Button("Sign Out"))
     {
         ((PlayGamesPlatform)Social.Active).SignOut();
     }
 
     GUILayout.EndVertical();
     GUILayout.EndArea();
 }
 
 }


Here is what i get in logcat 07-22 15:43:00.678: I/Unity(1222): NullReferenceException: Object reference not set to an instance of an object 07-22 15:43:00.678: I/Unity(1222): at GooglePlayGames.Android.AndroidClient+c_AnonStorey0.<>m_1 () [0x00000] in :0 07-22 15:43:00.678: I/Unity(1222): at UnityEngine.AndroidJavaRunnableProxy.run () [0x00000] in :0 07-22 15:43:00.678: I/Unity(1222): at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 07-22 15:43:00.678: I/Unity(1222): Rethrow as TargetInvocationException: UnityEngine.AndroidJavaRunnableProxy.run() 07-22 15:43:00.678: I/Unity(1222): at UnityEngine.AndroidJavaProxy.Invoke (System.String methodName, System.Object[] args) [0x00000] in :0 07-22 15:43:00.678: I/Unity(1222): at UnityEngine.AndroidJavaProxy.Invoke (System.String methodName, UnityEngine.AndroidJavaObject[] javaArgs) [0x00000] in :0 07-22 15:43:00.678: I/Unity(1222): at UnityEngine._AndroidJNIHelper.InvokeJavaProxyMethod (UnityEngine.AndroidJavaProxy proxy, IntPtr jmethodName, IntPtr jargs) [0x00000] in :0

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Marzoa · Oct 17, 2014 at 02:30 PM 0
Share

Facing similar problems here. Did you manage to solve these?

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by GDesmoulins · Oct 02, 2015 at 12:26 PM

Hello Guys,

After 2 days of tests with Authentification problems, (ERROR_NOT_AUTHORIZED) I spotted my mistake : "PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder() .EnableSavedGames() .Build(); " I wrotted : ".EnableSavedGames()" but my game don't use it in Google Play interface, so the error occured ! Simply removing it (for my part), and let's rock n roll !

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by malekbakeer · Nov 21, 2014 at 04:50 AM

This Happened to me yesterday... u need to go to developer console then go to testing and activate Beta & Alpha testers... that simple

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image iboo · Mar 23, 2015 at 09:45 PM 0
Share

I faced similar problem, but it is not solved when I activated alfa and beta test :(

avatar image
0

Answer by fahadshafique · Nov 18, 2016 at 08:16 AM

i had the same issue...enable alpha testing from the developer console and add your mobile device email id to the console for testing

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Google Play Game Services plugin problem 4 Answers

Build Error for android 1 Answer

Google Play Services Offline Use 0 Answers

Error text from google game services 0 Answers

Help with c# script for new google play adverts 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges