问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/51098646/google-drive-api-stops-working-after-publishing-app