Google Drive Api stops working after publishing app - android

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.

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

FCM notifications working in release mode but *not* from Play Store

So, I have FCM notifications setup on my flutter app. It works both for android an iOS in both debug and release modes.
When I create a release apk and test it on my phone, notifications work. But when I upload an appbundle to the play store, the version I download from the play store has notifications not working. The getToken method returns null, any ideas on why this could be the case?
I think you have not added SHA fingerprints for your release signing key. If you have selected something like this "Let google manage and protect your app signing key (recommended)", then you should go in Play Console, and then choose your app, go to App Signing under Setup (New version of Play Console). Your fingerprint will be available below "App Signing Key Certificate", copy it, then go to Firebase Console, inside your project, go in project settings, and then finally add your copied fingerprint. then download latest Google-services.json file and add it to your project. If you have not enabled Google signing, you have to find your fingerprint from the local signed key (which you used) using keytool and then add it.
Read this: https://developers.google.com/android/guides/client-auth
https://support.google.com/firebase/answer/9137403?hl=en
Did you add the SHA1-fingerprint of your signing key to your firebase project? Android requires you to add the SHA1 fingerprint of your keystores to firebase. You can do so in project settings in firebase console.
If you are using Google Play App Signing you need to use the SHA1 from google play since Google will replace your release signing key with the one on googles server

Google SignIn and Facebook Login does not work every time I push an update of my app to playstore

I am currently working on an app which integrates Google and Facebook sign in. I have added the sha1 fingerprint in Firebase and have added the corresponding google-services.json file in the project and also have added the keyhash in the facebook developer console. After signing the app with release keystore the app works fine but when I push that to playstore and install it from there Google sign in does not work and in facebook login it shows invalid keyhash where has just before updating the app in playstore it worked fine.What can be the possible reasons for this?
Please check below points for solutions
Google changed the behavior of uploading APK Release APK and debug APK has different SHA1 and different API keys for google services. Both of them must be added in Firebase Console -> Project settings. Then download google-services.json from here, add it to project and recompile with release keystore using the option "Build signed APK".
When you upload an apk to the play store then play store creates a new SHA1 key called "App signing certificate". You get that SHA1 and save in your console or firebase account (as you need).
New SHA1 will be found at Released Management->App Signing on your play console.
please check apk when you generate signed apk build type must be release.
This is highly helped to me. i get the SHA1 for Android App from Google Play Console.
Then i use the below link to Generate the Key Hash and added to facebook app's Basic settings.
http://tomeko.net/online_tools/hex_to_base64.php
Thanks.

Firebase Authentication is failing with "Developer Error" after uploading apk to google play store

I am using Firebase Authentication for authenticating user in my application.
Everything was working fine till I was working on debug build of my application. But the moment I have uploaded the signed apk in playstore, my user authentication service always fails with "Developer Error" message.
On some web research, I find out that I need to generate SHA certificate for my signed apk also. I have generated SHA with locally created ".jks" file, which I have used to sign my application locally before uploading. I have added the generated SHA keys to firebase project console and generated new google-services.json file. Even this approach has not helped me.
I am suspecting that this is happening because I am using "Google Play App Signing (https://developer.android.com/studio/publish/app-signing.html)" which is again changing the certificate. Can anyone please help me and let me know what is the right process for updating SHA keys for release apk.
If play store is doing the app-signing, then how can it be the part of "google-services.json" where SHA keys must be mentioned beforehand?
Please help!!!
Open App signing section in Google Play Console, and get SHA1 of app signing certificate
if you are using local .jks file for signing, you dont need to google play app signing. after adding your .jsk file's fingerprint into firebase console. just sync it in android studio or try to run the app on your phone first after that build a new signed apk. Then upload it on playstore.

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

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.

Categories

Resources