onmyway133 / notes

:notebook_with_decorative_cover: Issues and solutions I found during development, mostly iOS
https://onmyway133.com/
MIT License
62 stars 4 forks source link

flutter google_sign_in #521

Open onmyway133 opened 5 years ago

onmyway133 commented 5 years ago

com.google.android.gms.common.api.ApiException: 10:

https://medium.com/flutter-community/auth-in-flutter-3f4ffe0ddcf8

It seems no need for adding google gms dependency, flutter seems to add api 'com.google.android.gms:play-services-auth:16.0.1' 🤔

build.gradle classpath 'com.google.gms:google-services:3.2.1' app/build.gradle apply plugin: 'com.google.gms.google-services'

google-services.json

onmyway133 commented 5 years ago

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

onmyway133 commented 5 years ago

https://console.developers.google.com/apis/credentials

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

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

https://stackoverflow.com/questions/47437678/why-do-i-get-com-google-android-gms-common-api-apiexception-10/47480986

onmyway133 commented 5 years ago

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.config
        }
        debug {
            signingConfig signingConfigs.config
        }
    }