Google Sign In Service not working after publish on PlayStore

前端 未结 3 1676
感情败类
感情败类 2020-12-10 20:03

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 servi

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-10 20:51

    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 !

提交回复
热议问题