I have a little game under development where I added some achievements.
There is a huge problem.
I added the required plugin (Google Play Plugin - Play Games For Unity 0.10.12) but when I do a normal build for release, the achievements won’t work.
In addition, when I do the build with “Development Build” checked, everything works fine.
Any help/suggestions? I struggle with this issue for some time and I could not find any good solution…
Thanks you so much!
Ok. 99% errors regarding login is because of “Not adding or wrong SHA on google play console”.
Why sign in fails?
For Google Play Services to sign in successfully, you need to make sure the apk from where you are logging in should be allowed to make requests to google servers.
How to make the APK authorized to make requests to google servers?
Each apk built with a keystore has a SHA fingerprint. You need to make sure the SHA fingerprint is added in the google cloud.
You can fetch it with keytool command (check here on how to get SHA for each environment )
How many SHA fingerprints I need to add for successful authentication?
In Unity,
Development build uses android default debug keystore.
Release build uses the keystore you set in publishing settings of player settings
Google play store build which uses google play signing.
So in total 3 environments (dev, release and production). If you want all the above builds to authenticate successfully, add all 3 fingerprints.
2. Release (Get from Google play console → Your App → Setup → App signing → Upload key certificate ) 3. Apk/AAb downloaded from Google play store (Get from Google play console → Your App → Setup → App signing → App signing key certificate )
Where to add these SHA fingerprints?
Google Play Console. Check here for details on how to add a SHA fingerprint.
Above is taken from our plugin but the same rule applies irrespective of what ever plugin you use.
So,
To solve Auth in release mode → Add SHA fingerprint from your release keystore and add the credential in google play console
To solve Auth in the builds downloaded from Google Play Store → Add SHA fingerprint from Google Play Console → Setup → App Integrity section.
During auto testing on Google Console I have this as logcat:
FATAL EXCEPTION: [com.google.android.gms.chimera.GmsIntentOperationService$ChimeraService-Executor] idle
Process: com.google.android.gms, PID: 4660
java.lang.IllegalArgumentException: Component class com.google.android.gms.wallet.ocr.CardRecognitionShimProxyActivity does not exist in com.google.android.gms
at android.os.Parcel.createException(Parcel.java:2092)
at android.os.Parcel.readException(Parcel.java:2056)
at android.os.Parcel.readException(Parcel.java:2004)
at android.content.pm.IPackageManager$Stub$Proxy.setComponentEnabledSetting(IPackageManager.java:8026)
at android.app.ApplicationPackageManager.setComponentEnabledSetting(ApplicationPackageManager.java:3038)
at m.bfw.j(:com.google.android.gms.policy_payments@213380802@213380802067.395552306.395552306:2)
at com.google.android.gms.wallet.common.ModuleInitializer.b(:com.google.android.gms.policy_payments@213380802@213380802067.395552306.395552306:2)
at m.apa.onHandleIntent(:com.google.android.gms.policy_payments@213380802@213380802067.395552306.395552306:6)
at com.google.android.chimera.IntentOperation.onHandleIntent(:com.google.android.gms@213017037@21.30.17 (120400-395706864):2)
at ufi.onHandleIntent(:com.google.android.gms@213017037@21.30.17 (120400-395706864):4)
at elw.run(:com.google.android.gms@213017037@21.30.17 (120400-395706864):5)
at elv.run(:com.google.android.gms@213017037@21.30.17 (120400-395706864):11)
at byvc.run(:com.google.android.gms@213017037@21.30.17 (120400-395706864):2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Caused by: android.os.RemoteException: Remote stack trace:
at com.android.server.pm.PackageManagerService.setEnabledSetting(PackageManagerService.java:26034)
at com.android.server.pm.PackageManagerService.setComponentEnabledSetting(PackageManagerService.java:25778)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:3774)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:5110)
at android.os.Binder.execTransactInternal(Binder.java:1021)
Unfortunately, the logs have very different and weird exceptions. Do you have a open beta link to give a try on my device?
E/GooglePlayServicesUtil(15781): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
[verification_manager] Device is not consented
Regarding this, try opening OAuth Consent screen in google cloud console and change the status from testing to publish (It won’t affect any others other than consent alone).
I checked it. And it failed because of your minify/proguard settings.
E/Unity: AndroidJavaException: java.lang.ClassNotFoundException: com.google.android.gms.games.Games
java.lang.ClassNotFoundException: com.google.android.gms.games.Games
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:400)
at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
at com.unity3d.player.UnityPlayer.access$300(Unknown Source)
at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:154)
at com.unity3d.player.UnityPlayer$e.run(Unknown Source)
Follow this link to set it up correctly or disable it to quickly test if you don’t care about minifying.