I have a Flutter app with Google sign-in. I have added the SHA1 and SHA256 keys to Firebase, from a computer. and everything is alright from that computer.
but when I run the app from other computers I get this error
PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)
I have added also added support email as well. how can I fix this?
This happens because Firebase(and others) need to have the sha for each key registered. By default, android studio creates a debug signing key. When you collaborate with other people, you can create a key(or copy the one generated by AS) and set it up for the project.
./gradlew signingReport
> Task :app:signingReport
Variant: debug
Config: debug
Store: ~/.android/debug.keystore
Alias: AndroidDebugKey
MD5: A5:88:41:04:8D:06:71:6D:FE:33:76:87:AC:AD:19:23
SHA1: A7:89:E5:05:C8:17:A1:22:EA:90:6E:A6:EA:A3:D4:8B:3A:30:AB:18
SHA-256: 05:A2:2C:35:EE:F2:51:23:72:4D:72:67:A5:6C:8C:58:22:2A:00:D6:DB:F6:45:D5:C1:82:D2:80:A4:69:A8:FE
Valid until: Wednesday, August 10, 2044
Store: ~/.android/debug.keystoredebug.keystore in your root projectapp/build.gradleandroid { ... } sectionsigningConfigs {
debug {
storeFile file("../debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
}
push your changes and now everybody will use the same debug key and you don't need to register different SHA for every developer.
This is different than the release key, which you should never push on Git.
If you are using Firebase,
Go to app/build.gradle
Make sure the applicationId Under defaultConfig is same as the Package name in Firebase Project (see below)
defaultConfig { applicationId "com.ceylonguider.app" … }
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With