I have been having issues with signing in to google on a flutter app I am trying to develop. I keep on getting the same error on my debug console which is -
I/flutter ( 5171): PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null)
I have updated my SHA-1 and SHA-2 keys on my firebase console, which took me ages to find as the command line commands
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
keytool -list -v -keystore path-to-your-release-key.keystore -alias your-key-alias -storepass your-keystore-password -keypass your-key-password
show up with the following errors
keytool error: java.lang.Exception: Keystore file does not exist: ~/.android/debug.keystore
java.lang.Exception: Keystore file does not exist: ~/.android/debug.keystore
at java.base/sun.security.tools.keytool.Main.doCommands(Main.java:923)
at java.base/sun.security.tools.keytool.Main.run(Main.java:423)
at java.base/sun.security.tools.keytool.Main.main(Main.java:416)
keytool error: java.lang.Exception: Keystore file does not exist: path-to-your-release-key.keystore
java.lang.Exception: Keystore file does not exist: path-to-your-release-key.keystore
at java.base/sun.security.tools.keytool.Main.doCommands(Main.java:923)
at java.base/sun.security.tools.keytool.Main.run(Main.java:423)
at java.base/sun.security.tools.keytool.Main.main(Main.java:416)
PS C:\Users\marsd>
Im stuck and don't know what to do, any help would be greatly appreciated
The documentation is pretty poor and I also got this problem while generating the jks file. I found a solution though. You'll need to replace the 'path' with an actual path in your device. Something like this.
C:\Users\WINDOWS\represents the folder's path, whiledebug-keyrepresents the name for the jks file. Meanwhile,androiddebugkeyis the name of the alias. For the alias, you can name it whatever you want.After setting up the command properly, the command line will ask for the password, which you are required to fill, and after that private info such as first name, address, etc. You can choose to ignore the latter though by just hitting the enter key.
Once the jks file is generated, make sure to go to the folder you specified in the command then copy it. Paste it in the
android/appdirectory in your Flutter project. Then go toandroid/app/build.gradle, update thesigningConfigsandbuildTypessection like this.You need to modify accordingly based on the information you inserted in the command line. Note that this is just for the debug mode. For release mode you will need to repeat the entire step, and replace the
debug {withrelease {.Hope this helps your case.