Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Google Drive API Exception: 403 Forbidden

I'm developing an app that has access to user's appdata folder on Google Drive. When I am on debug mode, the app works fine. When I make a release of the app and I try to connect to Google Drive it give me this error after I choose which account to connect:

com.google.api.client.googleapis.json.GoogleJsonResponseException: 
403 Forbidden 
{
   "errors" : [ {
      "domain" : "global",
      "reason" : "insufficientScopes",
      "message" : "The granted scopes do not give access to all of the requested spaces.",
      "locationType" : "parameter",
      "location" : "spaces"
   } ],
      "code" : 403,
      "message" : "The granted scopes do not give access to all of the requested spaces."
}

I used this way to connect to Google Drive: https://developers.google.com/drive/v3/web/quickstart/android

I also make one credential for debug and one for release mode in Google Dev Console.

How can I solve this problem? Any help is apreciate. Thanks buddies!

like image 782
Daniele Avatar asked Feb 21 '26 20:02

Daniele


1 Answers

I had the same problem and the official ProGuard configuration here solved it for me:

https://github.com/google/google-api-java-client/blob/57fe35766cbba0a0d5a9a296be81468d730a29f8/google-api-client-assembly/proguard-google-api-client.txt

like image 194
Emanuel Moecklin Avatar answered Feb 24 '26 10:02

Emanuel Moecklin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!