googlesamples/google-signin-unity

Google Store Issue

MariuszJendrzejczak opened this issue · 5 comments

I have a weird issue.
I implement this plugin to sign in by google in the Android app.
I made all that stuff with QAuth, followed the instruction and everything worked fine until I upload my apk (as aab) to the google store.

When I download the app from the store (test path) I receive an error:

The full error:

Got Error: DeveloperError Exception of type 'Google.GoogleSignIn+SignInException' was thrown. <>c__DisplayClass8_0:b__0(Task`1) System.Threading.ThreadPoolWorkQueue:Dispatch()

I test it out and I know, that I get that error also if I put a wrong webClientId.
But the same apk works when I upload it to my phone directly, and not work when is signed by the google play store.

Anyone has any idea where should I look for solving this?

Could you check if minifyEnabled is true only for release? You could try setting minifyEnabled = false to see if it fixes the issue. (See #216)

Also, ensure you have configured support email in the project settings in firebase console.

Third thing, make sure your oauth_client details is for the signing key and not upload key in the google-services.json for the release.

Hope this helps.

I have a weird issue. I implement this plugin to sign in by google in the Android app. I made all that stuff with QAuth, followed the instruction and everything worked fine until I upload my apk (as aab) to the google store.

When I download the app from the store (test path) I receive an error:

The full error:

Got Error: DeveloperError Exception of type 'Google.GoogleSignIn+SignInException' was thrown. <>c__DisplayClass8_0:b__0(Task`1) System.Threading.ThreadPoolWorkQueue:Dispatch()

I test it out and I know, that I get that error also if I put a wrong webClientId. But the same apk works when I upload it to my phone directly, and not work when is signed by the google play store.

Anyone has any idea where should I look for solving this?

Have you ever tried to install your uploading aab directly?

I already had minify none in Unity publishing settings for Debug and Release.
When I tried to turn it on, the FB plugin didn't initialise.

The email was configured.

My google-services.josn looks like this: (ofc. I cut the URL and keys before publishing them here.

{
  "project_info": {
    "project_number": "536446807232",
    "firebase_url": "https://suns-and-clouds-default-rtdb.europe-west1........",
    "project_id": "suns-and-clouds",
    "storage_bucket": "suns-and-clouds.appspot.com"
  },
  "client": [
    {
      "client_info": {
        "mobilesdk_app_id": "1:53644.......",
        "android_client_info": {
          "package_name": "com.honeti.sloneczka"
        }
      },
      "oauth_client": [
        {
          "client_id": "536446807232-lsip7....",
          "client_type": 1,
          "android_info": {
            "package_name": "com.honeti.sloneczka",
            "certificate_hash": "sha from Unity key"
          }
        },
        {
          "client_id": "536446807232-ctk4qfl....",
          "client_type": 3
        }
      ],
      "api_key": [
        {
          "current_key": "AIzaSyDX...."
        }
      ],
      "services": {
        "appinvite_service": {
          "other_platform_oauth_client": [
            {
              "client_id": "536446807232-ctk4....",
              "client_type": 3
            }
          ]
        }
      }
    }
  ],
  "configuration_version": "1"
}

Have you ever tried to install your uploading aab directly?

Is there any easy way to install, abb directly to an android phone?
I upload to my phone only apk build.

You need to use the app signing key from App Integrity tab under developer console for building the release aab.

AppSigningKeyFromPlayStore

The SHA 1 fingerprint of the app signing key must be added to the firebase config and then you can download the new google-services.json file. You would find that there are two oauth_client elements. Remove the oauth_client using the upload key or unity key SHA when making the release build. For debug you would have to use the unity key as you are building the apk with it for local testing.

FirebaseConfig

adding SHA-1 from app integrity helps with the problem.
Thanks a lot for Your advice.