I've added version 4.0.4 of the Nativescript firebase plugin but I can't seem to get the Google authentication to work. Here are the steps I've taken:
Generate the keystore file with the following commands:
keytool -genkey -v -keystore debug.keystore -alias audibledebugkey -keyalg RSA -keysize 2048 -validity 10000
keytool -genkey -v -keystore prod.keystore -alias audibleprodkey -keyalg RSA -keysize 2048 -validity 10000
I've stored these files in the project directory in the .keystore directory. I got the SHA1 and SHA256 using these commands:
keytool -list -v -keystore prod.keystore -alias audibleprodkey -storepass Uey39jhUEvmfoFro -keypass Uey39jhUEvmfoFro
keytool -list -v -keystore debug.keystore -alias audibledebugkey -storepass dzryQnPtfVGHcJH1 -keypass dzryQnPtfVGHcJH1
Then I copy and paste the SHA1 and SHA256 into my project settings in Firebase and then download the new google-services.json and add it to the app/app_resources/Android directory. Finally, I build using the following command:
tns run android --key-store-path ~/Projects/audible/.keystore/debug.keystore --key-store-password dzryQnPtfVGHcJH1 --key-store-alias audibledebugkey --key-store-alias-password dzryQnPtfVGHcJH1
But, it does not work and the following error occurs:
JS: Make sure you've uploaded your SHA1 fingerprint(s) to the Firebase console
JS: Has the SHA1 fingerprint been uploaded? Sign-in status: Status{statusCode=DEVELOPER_ERROR, resolution=null}
What else can I try? Perhaps I missed a step? I didn't quite understand how to setup the Web SDK configuration; do I need to do something special for that step?
Related
I/BiChannelGoogleApi(15179): [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzaq#7a473f
I am getting this error when i press the login button . Also , i added the correct googleservices.json in app folder in flutter
Can anyone please tell me the reason why is it occuring so ?
Make sure you added the SHA 1 in the Firebase console. If you didn’t you can get the SHA 1 by
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Try getting your SHA1 and SHA256 with gradlew signingReport
I can login using google signin in debug mode.
I have also tried building an apk like flutter build apk --release and the signin also worked.
I then have proceeded to flutter build appbundle and upload the said bundle to the PlayStore. now none of my users can login into the app.
I ran gradlew signingReport
and a bund of sha1 keys were shown. Most of them where repetition so I used both the different ones that showed on the screen (one for debug other for release) and added them to my firebase config project
When someone tries to login the google popup showing the gAccounts on the phone appear for you to choose one or use a different one. when you press the one you want it disapears but it doesn't log you in. what am I missing?
This is for the debug sha1 key MAC
keytool -exportcert -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore
if you wants to generate the relase sha1 key Just replace androiddebugkey with your alisa name and ~/.android/debug.keystore with you keystore file path
For e.g.
keytool -exportcert -list -v -alias tashmania -keystore /Users/SunnySaini/Documents/git/tashmania/app/jks/tashmania.jks
While trying to get SHA certificate fingerprints I run this line and that was the result
line:
keytool -list -v -keystore %USERPROFILE%\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android
What else should I do to solve this error?
C:\>keytool -list -v -keystore %USERPROFILE%\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android
Illegal option: sisy\.android\debug.keystore
keytool -list [OPTION]...
Lists entries in a keystore
Options:
-rfc output in RFC style
-alias <alias> alias name of the entry to process
-keystore <keystore> keystore name
-cacerts access the cacerts keystore
-storepass <arg> keystore password
-storetype <type> keystore type
-providername <name> provider name
-addprovider <name> add security provider by name (e.g. SunPKCS11)
[-providerarg <arg>] configure argument for -addprovider
-providerclass <class> add security provider by fully-qualified class name
[-providerarg <arg>] configure argument for -providerclass
-providerpath <list> provider classpath
-v verbose output
-protected password through protected mechanism
Use "keytool -help" for all available commands
It looks like %USERPROFILE% returns a value with a space in it.
Try wrapping in quotes like
keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
While trying to get the debug certificate fingerprint to be used in firebase we got an error claiming that keytool is not recognized, but we downloaded jdk and set the path then this error appeared:
-alias : The term '-alias' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystor ...
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (-alias:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
It appears you're not typing the full command. You should be running:
keytool -list -v -keystore %USERPROFILE%\.android\debug.keystore -alias androiddebugkey -storepass <store_password> -keypass <key_password> (Where store_password and key_password default to android.
The output of this command will include the SHA1 and SHA256 fingerprints of your certificate which you enter in the Firebase console.
You should use this command, it will work!
keytool -list -v -alias androiddebugkey -keystore "%USERPROFILE%/.android/debug.keystore"
Password will be: android
keytool -list -v -keystore %USERPROFILE%.android\debug.keystore -alias androiddebugkey -storepass android -keypass android
im trying to generate a release certificate fingerprint for a google sign in with firebase and this is my problem
this is my command:
keytool -exportcert -list -v \
-alias goworkkey -keystore /home/ryan/Desktop/keystore.jks
This is my result:
keytool error: java.lang.Exception:
Only one command is allowed: both -exportcert and -list were specified.
if i try this:
sudo keytool -list -v -keystore /home/ryan/Desktop/keystore.jks -alias googlekey -storepass android -keypass android
I get this:
keytool error: java.io.IOException: Keystore was tampered with, or password was incorrect
java.io.IOException: Keystore was tampered with, or password was incorrect
at java.base/sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:780)
at java.base/sun.security.util.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:222)
at java.base/java.security.KeyStore.load(KeyStore.java:1479)
at java.base/java.security.KeyStore.getInstance(KeyStore.java:1807)
at java.base/java.security.KeyStore.getInstance(KeyStore.java:1687)
at java.base/sun.security.tools.keytool.Main.doCommands(Main.java:908)
at java.base/sun.security.tools.keytool.Main.run(Main.java:397)
at java.base/sun.security.tools.keytool.Main.main(Main.java:390)
Caused by: java.security.UnrecoverableKeyException: Password verification failed
at java.base/sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:778)
... 7 more
I had the same problem while running the command:
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore -list -v -storepass android
If I changed it to this:
keytool -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore
I was properly asked for a password, as explained here, https://developers.google.com/android/guides/client-auth
and all was well.
Do you still have the problem? As this youtube video go to the "Gradle projects" tab (to the right) -> Tasks -> android -> double click on signingReport and you will get it for all your variants: Take the SHA1 which have the Variant and Config type debug
I hope it will be useful for you!
Click on Project Structure which is on the right of Android Studio.
Click on Ads.
Tick AdMob
Click OK button
Wait for sync or manually sync if necessary.