Flutter Google Sign and Phone Auth error after publishing the app com.google.android.gms.common.api.b 10

Viewed 278

Google sign in and phone authentication were working fine in debug and release mode. But after publishing the app in play store, Google sign in produce the following error:

com.google.android.gms.common.api.b 10

enter image description here

Any suggestion is welcome. Thanks.

4 Answers

Google sign in and phone authentication were working fine in debug and release mode.

If you are absolutely sure about this, and that they debug and release keys were added to Firebase. Then the situation you are facing now can be explained by using a different key for your app store.

If you have opted in of google automatically manage signing, then it will have probably signed your app with a different signature than the one you currently have added to firebase console.

Log into your developer console, find the key being used to sign your app, and add that to Firebase, along with the existing keys.

This should\can be solved without having to publish a new release.

The solution is that given by Huthaifa Muayyad. I did what he said and it work.

Thanks.

Try by adding plugin and classpath to the app/build.gradle and android/build.gradle respectively. For reference, I am adding code below.

1)app/build.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'     //add this line
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

2)android/build.gradle

dependencies {
    classpath 'com.android.tools.build:gradle:3.5.0'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.gms:google-services:4.3.3'     //add this line
}

Update SHA-1 Key in Firebase project setting

enter image description here

Also check your google cloud project api key setting and also add SHA-1 Key credentials if you have Key restrictions.

enter image description here

Related