playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.47k stars 966 forks source link

GPGS crash when app open and ERROR_NOT_AUTHORIZED #1947

Open IgnatevSV opened 7 years ago

IgnatevSV commented 7 years ago

Using GPGS 0.9.41 and Unity 5.5.2f1 crashes after try to authenticate. Also i created another test project with only 4 buttons("activate", "authenticate", "show_achievements", "show_leaderboards"), signed it, loaded in dev console, created services, created xml, etc... No any reaction after:

PlayGamesPlatform.Activate(); And app crashes after:

Social.localUser.Authenticate((bool isSuccessful) => {Debug.log(isSuccessful)}); tolgau solution didn't help. https://github.com/playgameservices/play-games-plugin-for-unity/issues/1604 Just don't know, what to do...

I recreated test app with GPGS 0.9.40. So, after the same actions app no more crashes, but it send me "ERROR_NOT_AUTHORIZED". I double-checked SHA1 keys, Bundle ID, xml manifest, testers emails, enable test groups, apply testers invitations... But still can't login.

aca333 commented 7 years ago

Did you use logcat when testing with 0.9.41 ? To use logcat, you have to go to this path: F:\Android\sdk\tools or wherever your android sdk is located. Then click on monitor and you will see the logs.

I got an error that said APP_ID not found or something and it crashed. If you are having the same issue, then heres my solution

mobeenk commented 7 years ago

my game is crashing when I try to signin as well I use unity 5.4 with plugin version 9.41 desperate for a solution for days !!!

idurvesh commented 7 years ago

Same here, it used to work in the previous version. Upgrading to latest one crashes app while authenticating

IgnatevSV commented 7 years ago

Well, after so many wasted days, something started work...partially. I installed 9.38 ver of GPGS, setted xml, keys, etc. After that i also UPLOADED actual version of app in console and release it(as closed alpha) and installed my app through tester invite and google play. So, now i can login, view leaderboards and achievements. BUT! Sometimes i also still can't login and view this windows. Also in console, in testers reports i get 16(!!!) crash reports of "java.lang.Error" com.google.android.gms.common.internal.zzf$zza.zzb. And after all...I can use GPGS only if i installed my app from google play. If i directly install my apk from my PC, i also can't login. I'm pretty sure, that there is no need in app release(at least i didn't notice that in variety of tutorials and requirements), but maybe i miss something. But this 16 crash reports haunt my mind now...

mobeenk commented 7 years ago

But if you release an alpha How can you change the code later? Each time you want to test you will release new alpha?

IgnatevSV commented 7 years ago

Yes, each time i want to test something in GPGS. Pretty convenient, huh? If i reinstall it from PC, GPGS just won't login. Upd. Aaand again - after new build, upload and absolutely same setup actions I can't login. Even if app installed from google play. Upd2. After another try I finally login. But seems that achievement unlock is broken. Uff, I'm pretty tired of this...

sampenguin commented 7 years ago

We are also seeing crashes somewhere after activating the plugin, versions 9.38 and 9.41, Unity 5.6.3p1. Like others have checked and double checked all the dependencies, reinstalled multiple times. Not getting anything really useful out of the logcat...

It does show Op: SIGN_IN status: VALID, and I can see the google username popup slide away just before crash, so this crash is happening after an authentication handshake.

Is anyone else with this problem using a Firebase link with their app? Curious if that might be a factor.

sampenguin commented 7 years ago

Just solved our crash issue. Apparently we had an incorrect leaderboardID in the APK (different than the ID listed in GP console). Once this was corrected, everything worked again. So double check all your achievement and leaderboard IDs are EXACTLY correct on both sides, no extra spaces, etc.

It would be great if there was maybe some nicer error messaging around that kind of situation rather than a crash with no logging. :)

VusalJalilov commented 7 years ago

Built the Minimal project from the samples.

Android version - 7.0 Samsung Note 5

Inside Android SDK Manager: Android 7.1.1 (API 25) Google Play Services - 44 Google Repository - 58 Android Support Repository - 47

Using GPGS 0.9.41 and Unity 5.5.4p3 crashes after try to authenticate. Using GPGS 0.9.40 and Unity 5.5.4p3 connects to Google Play Games, lets me choose an account, then fails authentication. Using GPGS 0.9.39a and Unity 5.5.4p3 connects to Google Play Games, lets me choose an account, then fails authentication.

IgnatevSV commented 7 years ago

Thanks for feedback. I test achievements unlock and I always get "Could not Unlock, no achievement with ID ". I tested it in 2 apps(GPGS 0.9.38), i checked this achievement ID string in services and my app many times, copy-paste it, try to use const string from generated GPSIDs script, but nothing is worked... Also, anti-piracy is disabled, so i still don't understand why i need to install my app from GPS.

I'll try to use GPGS 0.9.36. The results will be reported later.

Upd. Well, in GPGS 0.9.36 correctly works achievements unlocking, authentication and leaderboards, but if app installed from google play. Upd2. Also, with GPGS 0.9.36 i had "Resolution Exception" problem, which perfectly solved by this solution: http://answers.unity3d.com/questions/1347425/problem-with-adds-play-services.html Maybe, that's the main key of all this problems.

adnannazir commented 7 years ago

Hello Anyone can suggest? I am also having exactly same issue. Something to do with the plugin version? Which version should I use to get rid of that exception that causes app crash.

xenonsin commented 7 years ago

@IgnatevSV What version of Unity are you running? I think people who upgraded to Unity 5.5.4+ can't use GPGS 0.9.36 I believe. Apologies, GPGS 0.9.36 is the earliest version that supports the new Unity 5.5+ interfaces

adnannazir commented 7 years ago

I am on Unity 5.3 if you are asking me.

IgnatevSV commented 7 years ago

@xenonsin Unity 5.5.2f1 as I wrote at first message, but sorry for late answer anyway.

maxbackcountry commented 6 years ago

Just wanted to share my solution as I had been struggling with this issue for some time before this got me on the right track:

I checked the log from the adb logcat and found the same error message as in https://github.com/playgameservices/play-games-plugin-for-unity/issues/1935

Look whether you also get a corresponding message to this:

09-2718:09:53.310: E/ValidateServiceOp(21248): Using Google Play games services requires a metadata tag with the name "com.google.android.gms.games.APP_ID" in the application tag of the manifest for com.awsum.dunnn"

If so, your android manifest is likely to cause the problem. But in my case there was a simpler solution than editing and overwriting the android manifest file.

When looking for the android manifest for the google play games services I realized that it was not in the assets/plugins/android directory. When installing the plugin it was copied to Assets/GooglePlayGames/Plugins/Android/GooglePlayGamesManifest.plugin. the But apparently Unity only merges manifests that it finds in the assets/plugins/android directory.

Solution: I just copied the folder “GooglePlayGamesManifest.plugin” into the assets/plugins/android directory and that did the trick.

amykishor commented 6 years ago

@maxbackcontry You made my day. I was struggling with it for more than 24 hours. Now its working.

aneeshpanoli commented 6 years ago

if anyone has the same problem as I had, the solution is given here. https://github.com/playgameservices/play-games-plugin-for-unity/issues/2013 I t solved a lot of unrelated unity crashes for me.

Steps to follow:

  1. Goto "Assets/GooglePlayGames/Plugins/Android/GooglePlayGamesManifest.plugin/" folder
  2. Open the Android manifest
  3. Replace "\ " with "\u003 before: "<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="\ 232323232323" />" after: "<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="\u003232323232323" />"

Build and run. And thank https://github.com/khaledElshimy

Nama3 commented 5 years ago

@aneeshpanoli Thank you SO MUCH! This worked like a charm for me, and I ended up modifying the template-AndroidManifest.txt file. I replaced "\ " by "\u003" directly in the template file, so I wouldn't have to update my manifest file everytime I have to add new resources and do the Setup thing.