Following this tutorial, I pasted this code into my Main Activity:
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
if (connectionResult.hasResolution()) {
try {
connectionResult.startResolutionForResult(this, RESOLVE_CONNECTION_REQUEST_CODE);
} catch (IntentSender.SendIntentException e) {
// Unable to resolve, message user appropriately
}
} else {
GooglePlayServicesUtil.getErrorDialog(connectionResult.getErrorCode(), this, 0).show();
}
}
I end up having to import a buncha libraries, but I still can't fix this error:
RESOLVE_CONNECTION_REQUEST_CODE cannot be resolved to a variable
any ideas??? I can't figure out which library contains this constant...
Update or reinstall Google Drive. If it still has the issue, you can attempt to remove the app from your device and reinstall it. Or upgrade it to the latest version, especially after you updated the Android OS. What's more, you'd better reinstall it from the Play Store instead of third-party sources.
Resolve a 403 error: User rate limit exceeded To fix this error, try to optimize your application code to make fewer requests or retry requests. For information on retrying requests, refer to Retry failed requests to resolve errors. For additional information on Gmail limits, refer to Usage limits.
Turns out when the tutorial specifies to start with an android project, they mean a Google Drive android project, which has different imports and class definitions, which aren't made clear from the tutorial. They actually give some starter code for a Google Drive android project, but they mislabeled it as just a "Android Quickstart" so I assumed it was no different from any other android project.
Here's where the link goes: Google Drive Android Quickstart, and the tutorial makes alot more sense if you use this code as a reference.
If anybody is curious what the fix to the original issue is, the constant should actually be
REQUEST_CODE_RESOLUTION
, but again, there are alot more changes so just use the Google Drive Android Quickstart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With