Skip to content
This repository has been archived by the owner on Jan 11, 2022. It is now read-only.

Error after updating to new Gradle version #120

Open
titovnick opened this issue Aug 28, 2019 · 6 comments
Open

Error after updating to new Gradle version #120

titovnick opened this issue Aug 28, 2019 · 6 comments
Assignees

Comments

@titovnick
Copy link

titovnick commented Aug 28, 2019

Hi!

After updating Android Gradle plugin to 3.5.0 and Gradle to 5.4.1 I am getting always an error from Drive API. Whenever I downgrade to old gradle, everything works like a charm. Is there any ideas why can it happen and what are the steps to resolve this issue? Thanks!

Response:

"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
"extendedHelp": "https://code.google.com/apis/console"
}
]
@sqrrrl sqrrrl self-assigned this Aug 30, 2019
@sqrrrl
Copy link
Member

sqrrrl commented Aug 30, 2019

Which particular sample was this for?

@titovnick
Copy link
Author

Hi @sqrrrl, thanks for your answer. Getting this for Deprecation sample.

@HeinousGames
Copy link

I am also getting this error, but can't downgrade my gradle plugin version to test if it will fix the issue. Is there another workaround available? I have also tried getting an access token from GoogleAuthUtil and setting it in the DriveServiceHelper calls with the setOauthToken method, but that also doesn't work.

@HeinousGames
Copy link

Turns out the solution is to add this line to the proguard file:
-keepclassmembers class * { @com.google.api.client.util.Key <fields>; }

I would recommend the sample project have its gradle plugin version updated, and a proguard file added to it to prevent users from reaching this issue.

@MarsVard
Copy link

@HeinousGames that doesn't fix anything, I started getting the error as well and I'm not even using proguard

@HeinousGames
Copy link

@HeinousGames that doesn't fix anything, I started getting the error as well and I'm not even using proguard

Please refer to this doc: https://developer.android.com/studio/build/shrink-code
It mentions that gradle plugin 3.4.0 turns Proguard into R8, and that when building release R8 is on by default (ie using gradle 3.4.0+ turns Proguard on). I believe to resolve the issue you must either turn R8/Proguard fully off, or add a Proguard file with the rule I mentioned previously.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants