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
1
Question by Pedrocosta2111 · Mar 13, 2017 at 09:04 AM · androidgoogle playgoogle play gamescrashingcrashes

Android game crashes on startup because of Google Play

As the title sugests, my android game keeps crashing because of Google Play. I know this since, in the first cene, I have a script with the following code:

 using UnityEngine;
 using System.Collections;
 using GooglePlayGames;
 using UnityEngine.SocialPlatforms;
 
 public class GooglePlayLogin : MonoBehaviour {
 
     // Use this for initialization
     void Start () {
         PlayGamesPlatform.DebugLogEnabled = true;
         PlayGamesPlatform.Activate();
         Social.localUser.Authenticate((bool success) => {
             Debug.Log(success);
         });
         DontDestroyOnLoad(this.gameObject);
 
     }
 }

I tried building the game with this script activated and deactivated and when I deactivate it, it doesn't crash. I've done some research and found a thread where someone says that this problem was caused by having plugins within the project trying to access older versions of GooglePlay but from what I've seen there's nothing like that (though I might have searched for it the wrong way so if anyone has any sugestions that would be appreciated).

Comment
Add comment · Show 5
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 liortal · Mar 13, 2017 at 10:45 AM 1
Share

can you post the crash log from the device? it would make it easier to find out what's wrong.

avatar image Pedrocosta2111 liortal · Mar 13, 2017 at 01:57 PM 0
Share

How do I get the crash log? I only found a bunch of ways that either required me to have linux or to have my android device connected to my computer (which neither case happends).

EDIT: Sorry, when it comes to cases like this I'm a real rookie :/

avatar image liortal Pedrocosta2111 · Mar 13, 2017 at 06:52 PM 0
Share

you should connect an android device to your computer, reproduce the crash and then get the device log using logcat.

Show more comments

2 Replies

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

Answer by skillbow · Mar 14, 2017 at 06:02 PM

I had the same problem and solved by following advice from this thread: https://github.com/playgameservices/play-games-plugin-for-unity/issues/1604

It seems there is an incompatibility between the GooglePlayGames plugin and version 10.2.0 of the Google Play Services. So the best thing to do is roll back Google Play Services to 10.0.1

The full steps are from tolgau on the above thread (about 7 comments down).

In addition to the thread answer I would suggest using PlayGamesPlatform.Instance.IsAuthenticated() instead of Social.localUser.authenticated if you want to check whether the user is currently authenticated.

Comment
Add comment · Show 10 · 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 Pedrocosta2111 · Mar 16, 2017 at 03:03 PM 0
Share

I done that, but now the game doesn't even build. Im getting the following error: CommandInvokationFailure: Failed to re-package resources. See the Console for details. Android$$anonymous$$anifest.xml:19: error: Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version')

Any ideas on what to do?

avatar image skillbow Pedrocosta2111 · Mar 16, 2017 at 06:41 PM 1
Share

Can you post a screenshot of your Assets/Plugins/Android folder. Also what version of Unity are you running?

avatar image skillbow skillbow · Mar 17, 2017 at 06:02 PM 1
Share

You're missing play-services-base-10.0.1.aar and play-services-basement-10.0.1.aar

Show more comments
Show more comments
avatar image Pedrocosta2111 · Mar 31, 2017 at 02:30 PM 0
Share

I'm sorry to bother you again. But out of a sudden, my game doesn't build and just gives me this error: https://pastebin.com/k5zw07$$anonymous$$T I swear, I have nightmares with Android$$anonymous$$anifest.....

avatar image skillbow Pedrocosta2111 · Apr 01, 2017 at 04:07 PM 1
Share

I'll take a proper look through the errors in a moment but have noticed that "play-services-basement-9.0.0" is in your list. It may make no difference at all but it's probably worth taking out just to make sure.

avatar image Pedrocosta2111 skillbow · Apr 02, 2017 at 05:43 PM 0
Share

Wow it worked. I don't know why as the only times I changed those files was to solve the previous error and at that time it was able to build. Only now all of a sudden it started acting up. But all is well, thank you very much. Have a nice day :)

Show more comments
avatar image
1

Answer by liortal · Mar 14, 2017 at 05:51 PM

Your crash might be related to this bug: https://github.com/playgameservices/play-games-plugin-for-unity/issues/1635

The solution is to force the project to use Google play services libraries with version 10.0.1.

You can force the "Google Play Services Resolver" to use a particular version, by editing a class named PluginVersion. This class contains all the configurations that are used by the resolver (including which google play services libraries to download and include in the project).

Comment
Add comment · Show 4 · 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 Pedrocosta2111 · Mar 15, 2017 at 04:41 PM 0
Share

I done that, but now the game doesn't even build. Im getting the following error: CommandInvokationFailure: Failed to re-package resources. See the Console for details. Android$$anonymous$$anifest.xml:19: error: Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version')

Any ideas on what to do?

avatar image liortal Pedrocosta2111 · Mar 19, 2017 at 05:31 PM 0
Share

you probably didn't include the google play services libraries in your project. you should make sure that they exist (they should be automatically resolved using the "resolver" infrastructure that most plugins include).

If you still can't make it, plz contact me via this link- https://www.fiverr.com/lysergide/fix-android-build-issues-in-your-unity3d-project

avatar image skillbow liortal · Mar 19, 2017 at 06:08 PM 0
Share

If you use the resolver I think it will keep promoting you to use the 10.2.0 versions

Show more comments

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

7 People are following this question.

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

Related Questions

Game crashes on certain Android phones 1 Answer

Google play game service won't authenticate 1 Answer

Google Play Services Crashes Multiple Scene Game 0 Answers

Google Play Realtime Multiplayer Only Works On One Account 0 Answers

I want to obtain my Signing certificate fingerprint (SHA1) to test Google Game Serviceses is working ANY HELP? 3 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