Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Sign In Service not working after publish on PlayStore

I created My SHA-1 with my .jks file, after i created my google-services.json with my package name and SHA-1 code. After i published my app to Appstore. and my Sign In service worked perfectly, But one hours later all service is down.

And i used same SHA-1 for every Platform, and i checked again still same SHA-1.

Android Studio SHA-1 output

Anroid Studio

My Google Play-service.json SHA1 Servicejson

Play Store SHA-1, Maybe i need to use App-Signig cert? Play Store

what's wrong?

like image 564
Berat Eyüboğlu Avatar asked Dec 23 '22 14:12

Berat Eyüboğlu


2 Answers

I fixed this problem, Firstly i downloaded my apk from play store and i unzip my apk and checked my SHA, and i saw Play Store used App-Signing cert SHA. but i used Upload-Cert SHA everywhere.

after i changed my API sha to Play Store App-Signing SHA, worked perfectly.

like image 56
Berat Eyüboğlu Avatar answered Dec 27 '22 01:12

Berat Eyüboğlu


If you enabled "Google Play App Signing" when publishing your app, you are now probably dealing with two fingerprints:

  1. The one coming from your local keystore (keytool -exportcert -keystore path-to-production-keystore -list -v), known as the "upload cert".

  2. The new one generated by Google when you enabled Signing (the "signing certificate").

The conflict with this situation, is that you also have two OAuth 2.0 client IDs:

  1. The one that you created before publishing your app (and before enabling google signing).
  2. A NEW one created by Google when you enabled Google Signing.

You can verify this fact from: Google Play Console -> Games Services -> Select your App -> API Console project -> Credentials -> OAuth 2.0 client IDs

SOLUTION

In order for Google Sign-in (and all related Games Services features) to work, I had to correct the fingerprint for my pre-existing OAuth2 Client ID (the one that I created before publishing my app).

  1. Look for the "right" OAuth 2.0 client ID: Google Play Console -> Games Services -> Select your App -> Linked Apps --> Select your App --> Take note of the "OAuth2 Client ID" at the bottom.

  2. Look for the "Signing" certificate: Google Play Console -> Games Services -> Select your App -> API Console project -> Credentials -> OAuth 2.0 client IDs --> "Android client for XXXXXX (auto created by Google Service)" --> Take note of the value (xx:xx:xx:etc....) Comment: In order to reuse this value in my other OAuth 2.0 client ID, I had to replace it with some dummy number. Otherwise, you will get error: "Certificate already used in some other project".

  3. Go to your pre-existing OAuth2 Client ID: Google Play Console -> Games Services -> Select your App -> API Console project -> Credentials -> OAuth 2.0 client IDs --> Select "OAuth 2.0 client ID" from step 1. Update certificate value with the one from step 2.

This solved my issue. Multiplayer is working perfectly !

like image 20
Pablo Alfonso Avatar answered Dec 27 '22 01:12

Pablo Alfonso