Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
avatar image
0
Question by Galatia410 · Apr 10, 2017 at 03:51 AM · google playleaderboardsocial

google leaderboard crashing my game?

Modifying post after some great help :) updated code and tried to provide longcat(I filtered with the word "unity" seemed to work, but not sure that that was the correct option as im new to android debugging). also the crash log i filtered with the app name, seemed to get more items that way. I would also like to add that Login to google is successfull, and achivements and IAP work, only issue is the leaderboard crashing the game.

Honestly not sure what im doing wrong any help would be appreciated. I have gotten references from google play console, have all of the google play items from sdk manager. my game authenticates users just fine, but when i use the following code the game crashes as soon as i click the show leaderboard button... do i have something wrong with my code or any suggestions on how to trouble shoot this? Its ShowGLeaderboard() that causes the issue.

i have this at the top:

using GooglePlayGames;

using UnityEngine.SocialPlatforms;

using GooglePlayGames.BasicApi;

this is my code to sign into google in my start function:

     PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder ().Build ();

     PlayGamesPlatform.InitializeInstance (config);
     // recommended for debugging:
     PlayGamesPlatform.DebugLogEnabled = true;
     // Activate the Google Play Games platform
     PlayGamesPlatform.Activate ();

     LogInToGoogle ();

function to sign into google:

 // Google Play Services
 public void LogInToGoogle()
 {
     Social.localUser.Authenticate((bool success) =>
     {
         if (success)
         {
             LoggedInToGoogle = true;
             Debug.Log("Signed Into Google");
         }
         else
         {
             LoggedInToGoogle = false;
             Debug.Log("Signed Into Google Failed");
         }
     });
 }

Function to show leaderboard:

 public void ShowGLeaderboard()
 {
     PlayGamesPlatform.Instance.ShowLeaderboardUI ("CgkI96qIrZYMEAIQBg");
 }

alt text

Crash log longcat keyword deathworms

dwcrash.txt (5.5 kB)
Comment
Add comment · Show 2
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 SohailBukhari · Apr 10, 2017 at 06:54 AM 1
Share

$$anonymous$$ake sure You setup properly goolge playgames setup in unity Editor. Replace Your Start with folowing code.

 void Start()
     {
         PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder ().Build ();
 
         PlayGamesPlatform.InitializeInstance (config);
         // recommended for debugging:
         PlayGamesPlatform.DebugLogEnabled = true;
         // Activate the Google Play Games platform
         PlayGamesPlatform.Activate ();
 
     }

And Then Call this code to show leaderboard.

     PlayGamesPlatform.Instance.Show$$anonymous$$erboardUI (''xxxxxxxxxxxxxx'');


avatar image Galatia410 SohailBukhari · Apr 10, 2017 at 03:34 PM 0
Share

thank you very much. I cant say it worked but should help me with debugging :)

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by aditya · Apr 10, 2017 at 05:12 AM

You are activating google libraries then checking if user already logged in, if not then you are calling a function LoginToGoogle and this function is again activating google libraries

But if this is not the problem then pls build a Debug App and send us a log of your app where this crash is occurring

Comment
Add comment · Show 2 · 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 Galatia410 · Apr 10, 2017 at 03:37 PM 0
Share

thank you very much i didn't realize my redundancies with activating google libraries. ill try to figure out how to debug on my phone, ive been struggling with that, but once i get it figured out ill post a debug log.

avatar image aditya · Apr 13, 2017 at 05:04 AM 0
Share

@Galatia410 one line in your log saying "UNABLE TO GET RESOURCES" and i think your device is unable to provide enough resources to your app to show/start the activity of google play leaderboard ...

avatar image
1

Answer by zero_null · Apr 10, 2017 at 10:26 AM

Make sure you are using the latest SDK for Google Play Leaderboard which is updated just few days back. The previous version v0.9.36 doesn't support the AARs version 10.2.0 Here is how I worked around this issue:

Go to Assets > Play Services Resolver > Android Resolver > Settings Un-tick Enable Background resolution (This will suppress the update notifications once we downgrade the .aar files) Go to \extras\google\m2repository\com\google\android\gms Inside each of the folders there are version folders (such as 10.0.1, 10.2.0). And inside those are the .aar files we need. We will need the following files: play-services-ads-10.0.1.aar play-services-ads-lite-10.0.1.aar play-services-auth-10.0.1.aar play-services-auth-base-10.0.1.aar play-services-base-10.0.1.aar play-services-basement-10.0.1.aar play-services-clearcut-10.0.1.aar play-services-drive-10.0.1.aar play-services-games-10.0.1.aar play-services-gass-10.0.1.aar play-services-nearby-10.0.1.aar play-services-tasks-10.0.1.aar Under \Assets\Plugins\Android delete the 10.2.0 versions of the .aar files above, with their META files. Copy the 10.0.1 versions over Build and run your project. If you don't do Step 2, Play Services Resolver will keep asking you to update these .aar files.

I hope I was able to help anyone encountering this issue.

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 Galatia410 · Apr 10, 2017 at 03:39 PM 0
Share

thank you, Ive done all this already but still great answer, it was hard to find when that was my issue.

avatar image
0

Answer by gavinlewis · Apr 10, 2017 at 09:12 AM

YOU can google it: this is the site

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

68 People are following this question.

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

Related Questions

Google Play Services Unity Plugin not Show Leaderboard 1 Answer

Google Play Leaderboard help 0 Answers

Social.ShowLeaderboardUI not showing up on MacOS Standalone 0 Answers

Google +1 Button on Unity Android 1 Answer

Google Play Games Plugin(A simple issue) 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