Skip to content

How to fix ApiException: 10 in Flutter for Android #188

@onmyway133

Description

@onmyway133
Owner

Get error com.google.android.gms.common.api.ApiException: 10 with google_sign_in package.

Read https://developers.google.com/android/guides/client-auth

Certain Google Play services (such as Google Sign-in and App Invites) require you to provide the SHA-1 of your signing certificate so we can create an OAuth2 client and API key for your app

console.developers.google.com/apis/credentials

Credentials -> OAuth client id
If we specify SHA1 in firebase, then console.developers.google.com will generate an Android oauth for us

keytool -list -v -keystore {keystore_name} -alias {alias_name}

Use correct keystore for debug and release

buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.release
        }
        debug {
            signingConfig signingConfigs.debug
        }
    }

Activity

Fightlapa

Fightlapa commented on Oct 15, 2019

@Fightlapa

What if I'm also using backend and I use client id of my backed credentials which does not require any SHA-1 or anything?

shredding

shredding commented on Oct 5, 2020

@shredding

If you run into problems in release mode albeit you've added your release sha1 to firebase, add the release key from play store as well:

https://play.google.com/console/developers/<your-company-id>/app/<your-app-id>/keymanagement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @shredding@onmyway133@Fightlapa

        Issue actions

          How to fix ApiException: 10 in Flutter for Android · Issue #188 · onmyway133/blog