I have an android app which uses firebase authentication (Facebook,Twitter,Gmail,Phone,Email). The following steps I have followed
Enabled all the authentication's in firebase console
Added the app debug and release "SHA-1" & "SHA-256" values in firebase project settings
Downloaded the latest google-services.json
Built the app using release config
The app is working fine in the debug environment, but when it does made a beta release in the google play. I get the following error:
For Phone Auth:
"And Internal error has occured.[INVALID_APP_CREDENTIAL:App validation failed"
For Gmail Auth
"Developer error in toast message"
"An Unknown error occurred" in snacker.
Please help me, I tried a lot. I don't know what i am missing here.
Any help is appreciated.
I see there are so many answers "INVALID_APP_CREDENTIAL" title for firebase. But there is one important step.
Please make sure you have added the SHA (SHA1 , SHA256) Fingerprint in project settings.
Navigate to Project Settings > Account Linking > Google Play "Manage Linking".
Download the latest "google-services.json" and update in the app.
Important: You need to Unlink the app from Google play and link it again.
The 4th step is very important for all other solutions to work.
Thanks :)
Related
I'm struggling to configure the firebase app distribution to deploy my android application. But I'm receiving the following error:
App Distribution halted because it had a problem uploading the APK:
[403] The caller does not have permission
It pretty sure that the problem resides in the step where I need to include the Firebase App Distribution Admin role through the Google Cloud console:
But, the *** role doesn't appear when I try to include it:
I tried to include the Firebase App Distribution Admin SDK Service agent but I received the error described at the beginning. Any advice will be appreciated! Thanks
I using firebase_app_check in my flutter app. And I use AppCheck in Firebase. it turned out to be not easy to set up, there are a lot of "white spots" in the documentation. so in order:
I enabled AppCheck on Firebase(for starage and Firestore).
I selected "Play Integrity"(so the documentation recommends) as attestation providers.
I added plugin firebase_app_check to my app.
But it not worked. the app(in debug mode) cannot retrieve data from the firestore.
Then I added "SafetyNet" as attestation provider. After this app worked(debug mode).
I publised my appbundle to Google Play. When I downloaded app from Google Play it not worked(cannot retrieve data from the firestore). I using obfuscation for my appbundle.
Why my app not worked with AppChecker in release mode?
Why "Play Integrity" not worked?
do I have to add code at the platform level? according to this document?
like this:
val firebaseAppCheck = FirebaseAppCheck.getInstance()
firebaseAppCheck.installAppCheckProviderFactory(
SafetyNetAppCheckProviderFactory.getInstance()
)
or is one plugin enough?
How I can fix it?
So I finally figured this one out, documentation is very scattered, so here is a summary:
WARNING: if you want to debug against your firebase backend with AppCheck enabled you have to get a debug token and add it in Firebase every hour or so. Only a physical iOS device can be debugged without this token. For iOS emulator you must first run your app via Xcode and get the token there. This is quite a drawback in AppCheck imo.
Android Debugging (Device and Simulator):
You have to use androidProvider: AndroidProvider.debug as described here
Then run your app, it wont work, BUT look inside the console for the following line: Enter this debug secret into the allow list in the Firebase Console for your project: 49367303-30f3-4913-a596-... if you don't see this line: hit Hot Restart.
Copy this code and open Firebase Console > App Check > Apps > click the 3 dots behind your Android app > Manage debug tokens, add your token here:
Android Production:
For production you first have to follow the steps in 1. Set up your Firebase project. NOTE Especially step 3 is very vague:
Register your apps to use App Check with the Play Integrity provider in the App Check section of the Firebase console. You will need to provide the SHA-256 fingerprint of your app's signing certificate.
What they mean is:
In google Play Console under: Release > Setup > App Integrity > App Signing > copy the SHA-256 certificate fingerprint.
Add this fingerprint in Firebase console > App Check > Apps > click your Android app > Play integrity
Now create a new build and upload it to Play Store.
iOS
I got this to work on iOS by following these docs:
1. Set up your Firebase project, follow all the links in that documentation, (which takes you to apple.com and back)
for debugging on iOS emulator follow this documentation
If you encounter build errors in Xcode (like I did), see my answer here
I have integrated Firebase phone authentication in my android project.
For this I have followed all the steps given in this link.
All works fine on my machine, Also I pushed this code to git.
Now when another user pulls that code, it doesn't work on his machine.
Error he is getting is -
com.google.firebase.FirebaseException: An internal error has occurred. [ INVALID_APP_CREDENTIAL:App validation failed ]
I have searhed for this error, but everywhere I found is -
Put your SHA1 key
Enable "phone authentication" in authentication
tab in your firebase project.
But I have already done that and all works fine on my machine. But doesn't work on another user's machine. Please help me.
Thanks in advance!
Perhaps, you should add the SHA1 debug certificate keys of all your team members from git manually unless it's a released build. You can add as many debug SHA-1 keys as you want in the Project Settings from firebase console for every member's development machines.
Alternative: Share your keystore file to all of them.
I've set up a React Native Android app using the react-native-google-signin package, and everything is working great. I created a keystore to sign the app, created the proper credentials, and have a downloaded google-services.json file in my android\app folder.
When I change the package name (which I need to do), the app initializes but throws GoogleSigninError: DEVELOPER ERROR (code 10) after I choose an account and authorize scopes. When I check the Google Developer Console, it show requests being made to the clientID associated with the old package name. I've tried:
reissuing the credentials
making a new project in the Google Developer Console
cleaning out the various gradle build directories
revoking permissions
My instinct from trying to find similar issues is that it's an Android build issue, which I'm not very familiar with. Any help would be appreciated.
That means application is misconfigured. This error is not recoverable and will be treated as fatal. The developer should look at the logs after this to determine more actionable information.
Generate new android appkeyvand clientID in google console. Because old key config with the old package name .
I have followed the tutorial here:
https://developers.google.com/identity/sign-in/android/start-integrating
to integrate Google sign in into my app.
However, the GoogleSignInResult.isSuccess() is always false. GoogleSignInStatusCodes.getStatusCodeString(googleSignInResult.getStatus().getStatusCode()) shows INTERNAL_ERROR. The docs here say "retrying should solve the problem", but it doesn't.
Any ideas on what's wrong?
Similar question here, but I have added the json file.
The problem was that I was running the app from Android Studio (without setting up signingConfig), so the app wasn't signed with my certificate, which Google Sign-in requires.
If you run from Android studio without signingConfigs, then it is using your debug key store to sign. You can try register your package name + debug key SHA1 in dev console for easy development:
Test google signin on Android in development phase