Android - google-services.json for debug and release mode - android

I created an Android project on Google dev console using debug SHA1 fingerprint and also generated google-services.json file using same debug SHA1 fingerprint for by Google oauth2 implementation. Everything works fine. To upload the app to Google Play, I created one more project on Google dev console with release keystore SHA1 fingerprint and did not generate google-service.json. However, app is working fine even in release mode and I am able to do Google login in my app.
So what exactly is the use of google-services.json file? Should I create a new google-service.json file for release mode and how is it working even without it? That file has client_id of Android project that I created with debug SHA1 fingerprint.
I have checked both these links - link1 and link2 but did not find any answers satisfying. Thanks.

You do not need another json file for the same project. Google has simplified some manual steps by giving json file. You Google Cloud Project ID is the only thing required at the client side. Google Play Services will check with their server at the time of auth. and if there's a clientId created on the said Cloud project with SHA1 of the app requesting the auth, then it will work.

Related

Facebook and Google Sign-in is not working in .aab release build. But it's working fine creating realse build in .apk format

I am struggling a lot with google and Facebook sign-in in my android app. Everything works well with release build if preparing in APK format but not with.AAB format. I have followed all steps required for signing a build related to the SHA1 key.
Setup the Firebase application
Add the debug, release SHA1 key to the firebase
Add the SHA1 signing key from the google play issue after uploading the app.
Then download the google-service.json file and then prepare the bundle (.aab) but still, it's not working.
For facebook sign in also works with release apk but not with .".aab" file
App uploaded to google play and then download it but still, it's not working.
I tried to debug the ".aab" and it throws the "result code 0", the debugging I have to perform on the ".aab" file through the AAB installer app.
I followed various articles on stack overflow and other sources but none of them worked. Seems problem only with Bundle (.AAB) file releases only.
Facebook login in my android app is working fine in release apk, but not working properly after publishing the same apk on play store
google signIn not working in release mode apk android
enter image description here
the same thing happened to me and I solved the problem in the following way:
Unlike with .apk, when uploading an .aab (app bundle), google now forces you to sign the file and it does so by default. when google signs it, it does so with a SHA1 that you can only see by accessing your google play console account in the signature section: (if you dont see the link, search in google by "Google Play Console - Play App Signing")
https://www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSEwiIn4b9j5PzAhVIndUKHfJEAuAYABAAGgJ3cw&ae=2&ohost=www.google.com&cid=CAESQOD2TOEC6QJViajlQLRKWuvyHeLErSwY_0eyjSXNXz3AzjyZhnMyB4frcnJdvfIXrAYvu5aNaGiEi2zTH_tFodY&sig=AOD64_2z6obL_QhyUwCO5ViGSBr7v6_mCQ&q&adurl&ved=2ahUKEwjElf78j5PzAhWCy4UKHUo2A5QQ0Qx6BAgCEAE
This is where you can see the SHA1 used by google: this SHA1 is the one that you must put in the firebase configuration (not the sha1 of your private signature in the aab file, but the sha1 of the google signature)
If you are using .aab then simply logon to play console and follow the steps
Select your app
Under release navigate to Setup menu
Click on App Integrity
A screen will open, then click on App Signing
Copy the SHA1 key and paste where you want to use.. :)
See this image for steps
I have spent around two days to fix this problem and finally I did it, it is just missing SHA certificate fingerprints.
For the APK file it is working fine and when I have used the AAB file and install it in device then Google Sign In didn't work.
You can find the SHA-1 certificate fingerprint from Google play console by following steps:
Login to Google play console.
Select your application.
Go to Setup section from left side.
Select Internal app sharing and click on it.
Here you can find the Internal test certificate and SHA-1 certificate fingerprint, please confirm it is missing in your Firebase project or not, if it is missing then just add it and it is working fine with AAB file too.
0
If you are using .aab then simply logon to play console and follow the steps
1- Select your app
2- Under release navigate to Setup menu
3- Click on App Integrity
4- A screen will open, then click on App Signing
Copy the SHA1 key and paste to you firebase console under android project
https://console.firebase.google.com/
This is unreasnable and painfaul.
After update firebase settings by Sha-1 from google play console
and generate signed APK all worked fine
but .aab worked only with me in internal testing not when upload it to third party like appcenter

Firebase Google sign in issue [duplicate]

I've made a chat app that uses Firebase's feature Real-time database.
I face a problem with google authentication. The problem started when I downloaded the app from the Play Store, the authentication was working perfectly when I was running the app in debug mode. When users try to sign in they get a toast message code:10 message:10.
I would like to note here that: I've added the SHA1 fingerprint. How can I solve this?
*Not sure if this is helpful but I've followed step by step this tutorial
You need three keys in order to make it work:
The debug key. Informations here.
The release key. Informations here.
Google Play App signing key. Informations here.
All these keys are needed in order to make the sign-in process work.
Other informations here.
After generating SHA1 for release key, I forgot downloading the new google-service.json file that caused the same error.
Make sure you follow the instruction https://developers.google.com/android/guides/client-auth to generate and add debug/release SHA1 to firebase console and download google-service.json after updated.
If you use Use app signing by Google Play option, you need an additional step:
After uploading app into google play console, go to Release management > App signing, copy SHA1 and paste to firebase console
Update
In the new google play console, the App signing key can be found as following:
Setup > App signing
Make sure you have added signed SHA1. If you are using debug one then it will not gonna work for live apk.
You need to put "debug.keystore" in this path C:\Users\USER_FOLDER_NAME.android
then in Android studio follow the below steps
1. Run your project
2. Click on Gradle menu
3. Expand Gradle Tasks tree
4. Double click on android -> signingReport
You can see SHA in Run Tab
for more information see link
For me the problem was that i registered app and enabled google signin on Firebase console but I was testing with the debug version of app which has slightly different package name (same name but ended with .debug) so it was not working because the debug app is not yet registered. so additionally to my release app i also added the debug app to the firebase project for the app and it generated it's own google-services.json which i download and set to src/debug/google-services.json.
I believe this might be useful to some one else.

Google Signin working in release apk but not on play store? [duplicate]

I've made a chat app that uses Firebase's feature Real-time database.
I face a problem with google authentication. The problem started when I downloaded the app from the Play Store, the authentication was working perfectly when I was running the app in debug mode. When users try to sign in they get a toast message code:10 message:10.
I would like to note here that: I've added the SHA1 fingerprint. How can I solve this?
*Not sure if this is helpful but I've followed step by step this tutorial
You need three keys in order to make it work:
The debug key. Informations here.
The release key. Informations here.
Google Play App signing key. Informations here.
All these keys are needed in order to make the sign-in process work.
Other informations here.
After generating SHA1 for release key, I forgot downloading the new google-service.json file that caused the same error.
Make sure you follow the instruction https://developers.google.com/android/guides/client-auth to generate and add debug/release SHA1 to firebase console and download google-service.json after updated.
If you use Use app signing by Google Play option, you need an additional step:
After uploading app into google play console, go to Release management > App signing, copy SHA1 and paste to firebase console
Update
In the new google play console, the App signing key can be found as following:
Setup > App signing
Make sure you have added signed SHA1. If you are using debug one then it will not gonna work for live apk.
You need to put "debug.keystore" in this path C:\Users\USER_FOLDER_NAME.android
then in Android studio follow the below steps
1. Run your project
2. Click on Gradle menu
3. Expand Gradle Tasks tree
4. Double click on android -> signingReport
You can see SHA in Run Tab
for more information see link
For me the problem was that i registered app and enabled google signin on Firebase console but I was testing with the debug version of app which has slightly different package name (same name but ended with .debug) so it was not working because the debug app is not yet registered. so additionally to my release app i also added the debug app to the firebase project for the app and it generated it's own google-services.json which i download and set to src/debug/google-services.json.
I believe this might be useful to some one else.

Firebase Google Signin error: com.google.android.gms.common.api.ApiException: 10 [duplicate]

I've made a chat app that uses Firebase's feature Real-time database.
I face a problem with google authentication. The problem started when I downloaded the app from the Play Store, the authentication was working perfectly when I was running the app in debug mode. When users try to sign in they get a toast message code:10 message:10.
I would like to note here that: I've added the SHA1 fingerprint. How can I solve this?
*Not sure if this is helpful but I've followed step by step this tutorial
You need three keys in order to make it work:
The debug key. Informations here.
The release key. Informations here.
Google Play App signing key. Informations here.
All these keys are needed in order to make the sign-in process work.
Other informations here.
After generating SHA1 for release key, I forgot downloading the new google-service.json file that caused the same error.
Make sure you follow the instruction https://developers.google.com/android/guides/client-auth to generate and add debug/release SHA1 to firebase console and download google-service.json after updated.
If you use Use app signing by Google Play option, you need an additional step:
After uploading app into google play console, go to Release management > App signing, copy SHA1 and paste to firebase console
Update
In the new google play console, the App signing key can be found as following:
Setup > App signing
Make sure you have added signed SHA1. If you are using debug one then it will not gonna work for live apk.
You need to put "debug.keystore" in this path C:\Users\USER_FOLDER_NAME.android
then in Android studio follow the below steps
1. Run your project
2. Click on Gradle menu
3. Expand Gradle Tasks tree
4. Double click on android -> signingReport
You can see SHA in Run Tab
for more information see link
For me the problem was that i registered app and enabled google signin on Firebase console but I was testing with the debug version of app which has slightly different package name (same name but ended with .debug) so it was not working because the debug app is not yet registered. so additionally to my release app i also added the debug app to the firebase project for the app and it generated it's own google-services.json which i download and set to src/debug/google-services.json.
I believe this might be useful to some one else.

Google Drive Api stops working after publishing app

I'm using google drive api in my app which works fine on both debug and release builds when I install it using .apk file.
But if I publish the same release .apk on playstore and then download it from there I can't sign in to Google.
All I can find regarding the issue is that people aren't using release keystore to generate credentials on Google's developer console, which is not the case for me.
I found a problem:
Check if you have been enrolled in App Signing program under Release Management. If yes, there must be two certificates - upload and App signing.
Copy Sha1 of App Signing certificate and create new OAuth client ID in developer console.
Then go to Firebase Project settings, add copied fingerprint to your app and download google-services.json.
Replace your existing google-services.json in android studio with downloaded one and you are good to go.
I have no idea when or why I enabled this thing. It replaces signing certificate of your uploaded application with the new one.

Categories

Resources