1

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?

uioporqwerty
  • 1,068
  • 3
  • 12
  • 30
  • Check out this post. https://stackoverflow.com/questions/45263840/where-could-i-find-sha1-fingerprint-in-nativescript-android-app/ You need to get the SHA1 fingerprint from your app and put it into your firebase app settings – Randy Johnson Jul 25 '17 at 12:07
  • Hmm, yes I've seen that. Unfortunately, I've followed those steps so I'm not sure what I've missed. :( – uioporqwerty Jul 25 '17 at 12:55
  • If you are testing on emulator make sure you are running the command to get the debug sha1 and not your prod one: keytool -exportcert -list -v \ -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore https://developers.google.com/android/guides/client-auth I see your debug lines above but your NS project may not be using the keystore you think it is for debugging. – Randy Johnson Jul 25 '17 at 14:08
  • I'm actually testing on device and I've tried using various different keystore files and adding their fingerprints to firebase. I'll try on emulator instead. – uioporqwerty Jul 25 '17 at 14:11
  • Tried it on the emulator and it didn't work. Same error. – uioporqwerty Jul 26 '17 at 03:10
  • How did you get this sorted in the end? – Pieter Feb 16 '19 at 22:39
  • Unfortunately, I didn't get this sorted out in the end. This was for a personal project that is now abandoned (heh). If you're still encountering the issue, I'd suggest creating a new question. – uioporqwerty Feb 17 '19 at 02:27

0 Answers0