• 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 SonicDirewolf · Nov 23, 2017 at 05:36 PM · androidcrashadmobgoogle play gameslogin

App crashes on google play login

I was having some problems with admob and google play services .aar files. I solved it using Play Services Resolver -> Force Resolve. But now whenever I create the apk the app crashes after the "Made with Unity" comes up. The app crashes because of the Login(); function as it works fine if I don't include it. This is the login function which I call at the starting of the game

 public void Login(){
 
         Social.localUser.Authenticate ((bool success) => {
         });
     }


HELP PLEASE!

Comment
Add comment · Show 3
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 hasitha · Nov 24, 2017 at 06:15 PM 0
Share

Can you please add your full script where you use google play services :)

avatar image SonicDirewolf · Nov 25, 2017 at 12:44 PM 0
Share

@hasitha here's the script I'm using. I made a brand new project without using admob. I have uploaded the apk to console and got the resources and the client id. But the game still crashes whenever I try to sign in. I'm using Unity 5.5.1f and play services plugin 0.9.42. Here's the script

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using GooglePlayGames;
 using UnityEngine.SocialPlatforms;
 
 public class googleplay : $$anonymous$$onoBehaviour {
 
     public static googleplay instance;
 
     void Awake(){
 
         if (instance == null) {
             instance = this;
         } 
 
     }
 
     void Start () {
 
         PlayGamesPlatform.Activate ();
     }
 
     void Update () {
 
     }
 
     public void Login(){
 
         Social.localUser.Authenticate ((bool success) => {
 
             if(success){
 
                 Debug.Log("YESSS");
 
 
             }
 
             else{
 
 
                 Debug.Log("NOOOOOOO");
             }
 
 
         });
 
     }
 
     public void ShowLeaderboard(){
 
         if (Social.localUser.authenticated) {
             PlayGamesPlatform.Instance.ShowLeaderboardUI (LeaderBoard.leaderboard_top_gunmen);
         } else {
 
             Login ();
         }
     }
 }

As soon as I call Login from a button the game just closes itself. It's driving me nuts. Help! And Thank You!

avatar image hasitha · Nov 28, 2017 at 07:13 AM 0
Share

Try updating to Unity 5.6.4p3. its the final version of unity 5 with bug fixes.

and try this also :

 void Start ()
 {
         
 PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder ().Build ();
 PlayGamesPlatform.InitializeInstance (config);
 PlayGamesPlatform.DebugLogEnabled = true;    // check logs
 PlayGamesPlatform.Activate ();
 
 Social.localUser.Authenticate (success => {
             
     if (success) {
         Debug.Log ("SignIn successful");
     } else {
         Debug.Log ("SignIn failed");
     }
     
     });
 
 }




check your terminal logs

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by SonicDirewolf · Nov 26, 2017 at 12:10 PM

Fixed it! Just Upgrade your Unity to 2017. It should work fine!

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

160 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 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 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

When I start my game on Android this crashes (google play problem) 0 Answers

Game crashes on start up after implementing Admob 0 Answers

Having trouble building android project after adding Google Play Games and Google adMob 1 Answer

android app crashes after unity screen (maybe because of AdMob?) 0 Answers

Google Play showing log in dialog but not loggin in. 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