Android Firebase Dynamic Links setup - SHA-1 not recognized - android

i am trying to setup my android app to use firebase dynamic links and am experiencing a problem in setting it up in the firebase console.
i had previously added my app to my firebase project to use the realtime database and it works with no isssues. i included the app's debug SHA-1 (which i obtained from the app-debug.apk).
now in the firebase dynamic links console screen, i can select my app from the drop-down list but it shows a warning in red "Please add SHA-1 for this Android app".
i even deleted the app from my firebase project and then added it again, also including the SHA-1 but i still get the red warning in the dynamic links console page when i select the app.
i'd appreciate any help in sorting this problem out (so that it recognizes the SHA-1).
note: i have 2 other apps which are included in my firebase project. one has a SHA-1 include and the other not. if i select these apps in the dynamic links console screen, the one with the SHA-1 selects with no warning message and the one without a SHA-1 displays (as expected) the warning message.
thanks

You need to add the SHA1 and SHA256 from your production certificate to firebase console
Log into firebase console
Select your firebase project, click on Configuration
Find your Android App, then go to SHA certificate fingerprints and add both the SHA1 and SHA256 fingerprints for your production certificate.
To obtain the SHA1 and SHA256:
keytool -list -v -keystore your_release_certificate.jks
You should also add your debug SHA1 certificate, go to your project folder and execute
./gradlew signingReport
your debug SHA1 (and all of them) will look like this:
8B:5F:27:7C:A6:59:9A:7C:BB:EF:2F:8B:17:A2:F6:1D:31:3B:73:E6

well, after doing NOTHING but trying again about 12 hours later, it's accepting the SHA-1. so i seems like firebase needs some time to process adding the SHA-1. IT WOULD BE NICE IF THEY INDICATED THAT WITH THEIR RED WARNING OF "Please add SHA-1 for this Android app". so annoying!

Go to the folder where you install your Android Studio nd then jre->bin, for me its like that:
"C:\Program Files\Android\Android Studio\jre\bin"
Then open cmd/terminal their and type the following command
./keytool -list -v -keystore
"C:\Users\USERNAME\.android\debug.keystore" -alias androiddebugkey
-storepass android -keypass android

Related

NativeScript Firebase Google Authentication

I am using NativeScript (Vue app) with the Firebase plugin to allow Google account logins.
The login button redirects to Google sign-in page but I cannot sign in. The error displayed is "This account already exists on your phone."
According to the plugin page this will happen if the SHA1 fingerprints have not been uploaded to the Firebase console.
There is no difference between a physical device or the emulator, neither between "tns run" and "tns build" and then uploading the APK manually.
The command I use is
tns run android --key-store-path ./keyStore.jks --key-store-password <my_keystore_password> --key-store-alias <my_alias> --key-store-alias-password <my_alias_password> --bundle
I followed these steps:
Used keytool to get the SHA1 and added it to the Firebase
console.
Downloaded the google-services.json file and added
it to the app/App_Resources/Android folder.
Used apksigner to
verify the SHA1 and it matches what I have in the Firebase console
as well as the keystore.
When I check the Firebase Analytics page I can see the connection, so I am using the correct app URI etc.
The following is printed in the terminal window:
JS: 'Make sure you\'ve uploaded your SHA1 fingerprint(s) to the Firebase console. Status: Status{statusCode=unknown status code: 12502, resolution=null}'
JS: 'Has the SHA1 fingerprint been uploaded? Sign-in status: Status{statusCode=unknown status code: 12502, resolution=null}'
I noticed another question regarding this on SO but it's not been answered and is a few years old.
Any suggestions/help would be greatly appreciated.
Something that worked for me was to delete the "Platforms" directory from the project files and then run tns build android --bundle.
I would also just verify that your SHA1 fingerprint that you can find with:
keytool -exportcert -list -v \
-alias androiddebugkey -keystore ~/.android/debug.keystore
is the same as one listed in your Firebase settings. (https://developers.google.com/android/guides/client-auth)
The other thing to check would be that you downloaded the google-services.json file after you added the SHA1 fingerprint. But it seems like you've already done most of that.
You have to provide yet another SHA-1 fingerprint.
Locate your debug.keystore (usually in %USERPROFILE%.android\debug.keystore).
Use keytool to retrieve key information as you did with your upload keystore.
Put retrieved SHA-1 into firebase authentication console.
That's all folks.

google map blank only at release (didn't work every comment on stackoverflow)

I've got blank screen only at release version.
(debug is fine.)
I've tried most of answer in stackoverflow... but it didn't works....
Please check below images.
I've put the key on debug & release xml and also make them list on console.developers.google.com.
What kind of things I can do more??
(And this is basic project what Android studio support which I can choose when I made new project at Android studio.)
enter image description hereenter image description here
First check on your Google Map Console's account whether your API is restricted or public.
if it is restricted for android then you have to provide package name with SHA1.
you can generate your SHA1 from command prompt
keytool -export -alias YourAliasName -keystore "your_jsk_path" -list -v
and also after deploying on playstore you have to add that SHA1.
you can get that SHA1 from Release Management > App Signing >App Signing Certificate.

Android [App Validation Failed] phone authentication error on Firebase

I have attached firebase on my existing android project and ran it. Here is the scenario:
If the app ran from android studio via developer mode, it(Firebase sign in via phone number) runs smoothly and I manage to log in.
However, whenever I build signed debug apk, Firebase does not allow to sign in. It gives the following message:
This app is not authorized to use Firebase authentication. Please
verify the correct package name and SHA-1 are configured in the
firebase console (App Validation Failed).
I have SHA-1 and SHA-256 key installed on Firebase console generated from my windows machine.
I would have normally provided the code however, I am guessing there is nothing wrong with the code. It works fine with the debug process. I have changed to the up-to-date google-services file from console.
Any help would be highly appreciated. Thanks in advance.
Here is my error:
When debugging, I used the normal debug key from .android/debug.keystore and this key is stored in the Firebase SHA1 field.So it worked perfectly. While trying to create a signed version, I generated a separate keystore file and created signed apk using that. Now, since the SHA1 key varied from the debug, the app was not recognized on the firebase console.
I changed the signed key to debug key. I did not want to go through a lot of changes.
If you are using another key to sign your production apk, you can obtain SHA-1 fingerprint like this:
keytool -exportcert -list -v \
-alias <your-key-name> -keystore <path-to-production-keystore>
Then you will obtain something like this:
Certificate fingerprint: SHA1: DA:39:A3:EE:5E:6B:4B:0D:32:55:BF:EF:95:60:18:90:AF:D8:07:09
After that just copy SHA1 fingerprint and paste in your firebase's project adding new digital print in following menu:
Project Overview => Pulse in the cog (settings) => Project Configuration => scroll to bottom => add digital fingerprint.

Google Sign In not working when built in my Android Studio

A third-party has developed the main structure for my app, including a Google Sign In. When they test it, it works. When I run the APK that they built, it works. When I build using the project files, it fails with a handleSignInResult:false error.
I've reinstalled Android Studio, installed all the possible SDKs, but to no avail. Does anybody have any idea why one project will build successfully on one computer, but not on mine?
Could it be something to do with the SHA-1?
Yes...You guessed it right.Its about SHA-1 Key.
You need to add you SHA-1 key generated from your PC keystore
How to get SHA-1 from Android Studio ?
Than add that key in your Firebase console or in Google Console
How to add SHA-1 key to console ?
First thing we need SHA-1 key for integrate google sign in we need to register this key in google developer or google api console,
As per my or other experiance SHA-1 key will change when you change your systm so you need to replace your SHA-1 key with latest from your systme.
You need to Generate Your SHA-1 Release Key for Gmail Login After Build Apk
Follow step
1.Open CMD terminal
Goto Java folder using
1. cd java
2. cd jdk1.8.0_112
3. cd bin
C:\Program Files\Java\jdk1.8.0_112\bin>
Enter Following Command:
keytool -list -v -keystore "PATH OF .jks Keystore" -alias android
Note: android is my Keystore Alias
then you will get this : Enter keystore password(Enter your keystore password)
Just update your sha-1 to firebase and goo to tools->Firebase->Authentication->click Connect to firebase.It worked for me;)
Get your sha from Gradle->app->task->android->click Signing report
copy the sha1 past to firebase project settings bottom.

After signed apk google plus login not working in Android? Is there any proguard option?

Before signing APK, Google Login was working fine.
After signing APK, it's not working, always failure.
For that, are there any proguard settings that I have to do?
My SHA1 and all credentials are fine but still not working how to solve?
Go to the Google live play store account.
Select your app.
Select App signing tab in left side
Copy both App signing certificate and Upload certificate's SHA 1 key.
Then go to google Api console or firebase developer console --> then select your project.
FireBase:
1.Project over view --> project settings(setting icon right side)
2.Click on the Project settings then add your fingerPrint(SHA 1 Key which you had copied from Google live play store account).
Google Api Developer Console:
Select your project. Click credentials tab on left side bar. Then select your api Key then click edit icon right side. Then add your SHA1 key.
That's all.
Finally i was created new key based on release SHA1, now google login and maps working fine after signed apk , no need to run keytool commands, in android studio takes care of everything. you have to follow steps that it.
Android Studio2.1.1
File->Project Structure->app(Left hand side)
->Signing(on top side)->(Click on green color + button and add your release keystore details)
->Build Types(next to the signing tap) and select release on left hand side then right hand side you will see the some fileds in that choose signing config to release then click ok.
Finally click Gradle tap right hand side, then
Project name->project name->Tasks->android->singingReport(click on that)
now your debug key and Release key was ready On RUN console check it
That might be because you've added SHA1 of only debug keystore.
Add another SHA1 of production keystore and it will start working. If you're using Linux of Mac OS, generate SHA1 like this.
keytool -list -v -keystore YOUR_PRODUCTION_KEYSTORE_PATH -alias androidproductionkey -storepass password -keypass password
For windows following should work.
keytool -list -v -keystore "YOUR_PRODUCTION_KEYSTORE_PATH" -alias androidproductionkey -storepass password -keypass password
It is better that you add one more OAuth key in the API Console, so that you end up having two OAuth ids, one with debug key SHA1 fingerprint and other with the release key SHA1.
This way, both your debug and release APK files will continue to work.
Just in case anyone made the same mistake as me regarding signing with incorrect keystore/file/password in the APK generator/wizard, see my answer at https://stackoverflow.com/a/45631945/1145905

Categories

Resources