Google Drive Api stops working after publishing app

半城伤御伤魂 提交于 2021-02-10 08:05:30

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!