I have upgraded my project from Firebase sdk version 5.4.4 to Firebase Sdk version 6.8.0, in unity version 2018.4.14f1. I have imported all necessary "dotnet3" unity packages into my project and taken a build and i get an error "This app is not authorized to use Firebase Authentication. Please verify that the correct package name and SHA-1 are configured in the Firebase Console. [App validation failed ]".
I have then generated "SHA-1" for my keystore again and added fingerprint in firebase console, tried changing project from "dotnet3" to "dotnet4" and imported all necessary "dotnet4" firebase sdk packages. Still i get the same error and i made sure package name, SHA-1 code are all correct and added, even then im facing issues regarding that.
Please help me regarding this issue, if my methods are wrong or is this an open issue with sdk version 6.8.0.
This sounds like you need to re-upload your SHA 1 for Android development.
The easiest way to do this is to use the keytool command installed with Java:
keytool -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore
The password for your debug keystore will be android, but if you're doing a signed release build (say for the Play Store), you'll want to use the appropriate keystore and credentials.
You then need to copy/paste the SHA-1 into the "SHA certificate fingerprint" field under project settings.
There is another great stack overflow answer here, but it is very Android Studio centric (you may not have it installed when developing in Unity).
I cover this at about the 5:12 mark of my getting started video if you'd prefer video instructions.
A few pro-tips before I go:
The Android debug keystore is randomly generated on each developer's machine the first time they build and deploy a debug application for Android. This means that you'll probably want each developer to upload their SHA-1 whose working on Firebase features (alternatively, each developer may want to setup their own Firebase sandbox for development purposes).
The combination of SHA-1 and your package name are what's used to identify which Firebase backend your game will use, so this could also be an effective mechanism to deploy separate staging and production backends.
dotnet4 should be used in most cases now (although Unity 2018 still lets you choose between 3 and 4). Generally, if you've chosen the wrong one the error you'll see is around Task. This is because Task didn't ship with the original version of C# that Unity used, so Firebase uses a library called Parse to retroactively add it (and make the API comparable to the Android and iOS counterparts). In .NET 4.x and higher, this means that you have two versions of Task included which will cause issues. The dotnet4 version of Firebase simply remaps any Parse specific functionality onto C#'s Task and uses the one that ships with Unity.
I hope this helps (and I hope that I properly identified the issue)
--Patrick
Related
I have en existing app (e.g com.company.app1)made in Unity, that occasionally pulls content from firebase in the live environment (after being built).
Now I am trying to make a second build, with a different project id (com.company.app2). This second build does not use firebase after being built - it loads data from firebase before being built, and therefore already contains the needed data.
I have added com.company.app2 as a second android app in my firebase configuration, but when trying to install the resulting app2.apk there's a clash between it and the existing installed app1.apk.
Below is the error Unity is showing when I press it's "Build and Run" button.
stderr[
adb: failed to install C:\Users\*\*\*\*\app2.apk: Failure [INSTALL_FAILED_CONFLICTING_PROVIDER: Scanning Failed.:
Can't install because provider name
com.company.app1.firebaseinitprovider (in package com.company.app2) is already used by com.company.app1]
]
My question is, how can I change the provider name in app2 so both app1 and app2 can coexist on the same device?
(I need to interface with firebase shortly before building, so I can't just remove the SDK).
Alright, so I ended up just removing the SDK, that works.
Sorry to anyone who has some similar problem.
We are develop an iOS app using react-native. And every time there is an update from developer, developer need to build and install on QA phone for testing.
Now, I am trying to use fastlane and firebase app distribution, to distribute new app for QA.
When I create new release, QA got an email notification about that, and they can check it on firebase app distribution. But there is no button for download and install, only message like this.
Device registered!
The developer now needs to update their app to run on your device. You'll get an email when the app is ready to test.
How to make it available to download?
Finally,
For release iOS app to firebase app distribution, you need to generate ad-hoc.
First, u need to create a profiles ad hoc key, u can create it on apple developer or use fastlane to generate it. Then save it inside your project.
Second, set export method inside build app to be ad-hoc.
Third, use get_provisioning_profile to get your profile ad hoc key.
I believe this is very likely because your version is already the same (I think it happened to me recently). Try updating your minor version of the app. (If you are not able to do this for some reason, you can just delete existing build and upload a new one).
I've been trying to achieve phone auth using Firebase authentication. It's working with an android emulator. I used a test number and a real number in the emulator. Both works. But only the test number is working with a real device and throwing this exception for other numbers
Error is:[firebase_auth/missing-client-identifier] This request is missing a valid app identifier,
meaning that neither SafetyNet checks nor reCAPTCHA checks succeeded.
Please try again, or check the logcat for more details.
I setup SHA key in firebase also.
I am guessing you have not enabled the Device Check API. All you need to do is enable the Device Check API on the cloud platform.
I think after some updates they have made this change that for Safety Net you need SH1 Authentication along with enabling Device Check API.
You can follow the Steps as mentioned here.
Once you enable the device check api. Restart your application. It should work like a charm.
Do lemme know if you need further steps.
SafetyNet is newly developed feature for android. But solved the issue without doing any changes in the App.
Following steps helped me to solve.
Release Version
Google Signs the Appbundle when you upload. So, Find and copy the SHA1 key of the app signed by google.
Google Play Console - App Signing Key
Navigate to your project -> Project Settings in Firebase Console and add SHA1 key by clicking on Add fingureprint.
Debug version
Navigate to android directory of your project with following command with Terminal.
cd android
Generate app signingReport and copy the SHA1 key
gradlew signingReport
on Mac :
./gradlew signingReport
Add the SHA1 key in firebase app.
Android has added SafetyNet you can read more here. But what you have to do is 1. enable the Android Device verification api here. and 2. If you haven't yet specified your app's SHA-256 fingerprint, do so from the Settings Page of the Firebase console. For more info read details here.
I resolved my issue by removing by old android studio sha-1 and sha-256 keys from firebase and adding a new one from the latest android studio.
I have fixed this error.
In my case I added two android projects with same SHA-1 in single firebase project.
Once I removed one project from firebase project.
Now it is working for me.
I found this after much searching and should work for you or anyone else who stumbles here:
Put this line inside app/build.gradle under dependencies
implementation "androidx.browser:browser:1.2.0"
It is because its do reCAPTCHA verification and opens up browser.
There are two ways Firebase Authentication accomplishes this:
SafetyNet: If a user has a device with Google Play Services installed,
and Firebase Authentication can verify the device as legitimate with
Android SafetyNet, phone number sign-in can proceed.
or
reCAPTCHA verification: In the event that SafetyNet cannot be used, such as when the user does not have Google Play Services
support, or when testing your app on an emulator.
So your solution is either one of two
Retest on a real device
Add reCAPTCHA verification functionality to your app so you can
proceed with your emulator.
This was worked for me :-
If your app is published on the play store, Copy App signing key certificate from the Google Play console (Release > Setup > App Integrity page). Insert your signing key to your Firebase Console(Project settings Page).
Follow this link - https://developers.google.com/android/guides/client-auth
I removed my phone number from phone number for testing on firebase and it was worked for me when working on real device not emulator.
I know the question is rather trivial and stupid, but I really need a solid confirmation.
The only things that matter for firebase + flutter are: SHA-1, google-services.json file, application ID and dependencies?
Suppose I added a debug and signed SHAs to the firebase, added a json file to the project, and then compiled the signed release and published it on Google Play. So after this, if I continue to create signed versions of the same application for testing, will they still connect to the firebase in the same way and will not affect the main version? Therefore, no matter in what quantities or versions they should all work, if the contents of json are the same and they have the same identifier?
I developed a app with Flutter and tested on my device using the command:
flutter run --release
and everything worked fine.
I also tried building the app with:
flutter build apk --release
and installing it manually, and still everything was ok.
I uploaded on the store, and now the login doesn't work anymore.
I tried looking at the logcat and the error i get when i try to login is:
I/flutter: exception: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 12500: , null)
I tried adding the appCompat dependency and I checked the the SHA1 keys, everything is in the right place, I can't figure out why when I download if from the store it doesn't work anymore.
You likely have to register your Play Store app signing key with API providers (in this case Firebase).
In your Google Play Console, visit Setup > App signing
Copy SHA-1 certificate fingerprint
In your Firebase Console, visit Settings > Project settings
Click Add fingerprint
Paste copied SHA-1 certificate fingerprint into Certificate fingerprint textfield
Click Save
Your app probably does not have the correct Google credentials for the Token API.
When you first signed up on the Google Play Console, you probably opted into Google's app signing service. What this does is, after you sign your app with your keystore and upload it to the Play Console, Google will actually sign your app with a generated keystore and roll that version out. You can access the keys with which the release version is signed from the console, under Release Management -> App signing -> App signing certificate.
Once you locate the certificate, you need to use the SHA1 key, and generate a new Android Oauth Credential, and then add that to your google-services.json. If you are not using Firebase, you will have to add the Oauth credential to your backend as well.
If you look at HarshitG's answer on this Android thread concerning the same issue, you can see a picture of where you can get the certificate information on the Play Console.
google signIn not working in release mode apk android
go to your google play console , in the release management you'll find app signing, under that there are two Sha keys ,coppy them without the sha part to the firebas projects SHA certificate fingerprints apk will work after that.
For those guys having such problem , They better have a look at the SHA certificate fingerprint assigned to their firebase account .
Both release and debug SHA certificate fingerprint is required .
To do this you can :
navigate to the android folder in you project
run this command ./gradlew signingReport
find release SHA certificate fingerprint
find debug SHA certificate fingerprint
add them to the firebase account SHA certificate fingerprints
redownload the google-services.json
Add it to your app level folder
Your done !
For release, you need to be sure that two more SHA certificate fingerprints
added to firebase apart from debug fingerprint. One can be retrieved via keytool (Upload key certificate) and the other one (App signing key certificate) can be copied from play console (App integrity section as described in above answers)
I had that problem and I had solved it doing this:
Add the command below in gradle.properties file:
org.gradle.java.home=C:\Program Files\\Java\\jdk-18.0.1.1.
In my case:
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
org.gradle.java.home=C:\Program Files\\Java\\jdk-18.0.1.1
Then, in terminal, change the directory to android. (I use windows)
cd android
Finally, i wrote ./gradlew signingreport in terminal and i got SHA1 and SHA-256. Add then to firebase.
Before mindlessly running commands n stuff lets get some concepts straight!!
Your app needs to get signed by a signing certificate / keystore (that .jks file) to create a release build. Release builds are created in either Debug mode or Release mode (We'll learn about this futher on)
There are 3 types of these keystore files that you will come across:-
Debug keystore generated by using ./gradlew signingReport
Upload keystore generated by following these instructions
Deployment keystore/Play Signing keystore which is automatically generated by Play Console when you first try to upload a app bundle there. (You can find it at Setup > App integrity > App signing). This keystore stays with Google. You do not have access to its .jks file. So its safe and wont get lost.
Now, I would say, if you wish to get your app on Play Store, DO NOT generate Debug keystore. Generate and ALWAYS use your Upload keystore only.
Why is this important?
Debug keystore are just able to sign your apps in Debug mode (not Release mode).
Even if you try to use flutter build appbundle with --release flag, you are gonna get a app-release.aab which is signed in Debug mode! You can never publish an app signed in Debug mode in Play Store.
Upload keystore can sign your app in Release mode which can be published on Play Store.
Therefore, if you intend to publish your app in future, generate upload keystore by following these instructions and make changes to you gradle files accordingly. Do not generate that debug keystore cuz you wont need it.
This explanation should make you understand that why some answers are wrong which recommend to get a Debug keystore
Now the proper answer to the above question.
Certain Google Play services (such as Google Sign-in and App Invites) require you to provide the SHA-1 of your signing certificate
So if you are signing you app with upload keystore, add the SHA-1 fingerprint of your upload keystore in Firebase Console > Settings Icon > Project settings > Add fingerprint
You can get the SHA-1 of Upload keystore using keytool -v -list -keystore /path/to/upload-keystore.jks
Also, you can get the SHA-1 of Upload keystore and Deployment keystore on Play Console at Setup > App integrity > App signing
Which SHA-1 should I add? There are two SHA-1 at Play Console.
You have to add both SHA-1 fingerprints to firebase.
Why?
For publish reviews you always have to submit your app signed with your Upload keystore. Play Console will accept your app update submission signed with that same Upload keystore only (So keep the Upload keystore safe). That's why, to make that Upload keystore signed App work properly you need to add SHA-1 of Upload keystore in Firebase.
After your publish review is Accepted, your app will be signed again using the Deployment keystore by Play Console (automatic), then it will be published on Play Store. So that's why to make that Deployment keystore signed App work properly you need to add SHA-1 of Deployment keystore in Firebase.