-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Api 19 Caused by: java.lang.NoClassDefFoundError: java.nio.charset.StandardCharsets #926
Comments
From what I can tell StandardCharsets was added in with api level 19, so this should work. |
But it crashes - in the previous version this was not. |
Is your target >19? |
I have the same problem. The min required API has not changed, but now it depends on |
Per android docs, java.nio.charset.StandardCharsets was added in API 19, and requires API >= 19, not strictly greater than 19: https://developer.android.com/reference/java/nio/charset/StandardCharsets Are you stating that the docs are wrong? (Entirely possible, of course, but I want to make sure there isn't some other confusion here.) |
2 weeks ago I was able to use this API on Android 4.2, but now I get this error. Is this API no longer supporting API below 19? |
Correct. We do not support Android before 4.4. |
It seems the library does not support Android before 4.4 only because of this charset class missing that was added in API 19 which only an UTF8 name? Anyway I reverted to version 1.33.0 of httpclient and version 1.30.1 of apiclient and "all is good" now and it appears to be working on all Android 4.x. Is that correct assumption? Wouldn't it be possible to include the minimum SDK in the library so we get a warning if we target a lower SDK? Other libraries are doing so and it could avoid bad surprises in production. |
I'm not sure. I'm hardly an expert in Android. Is there some standard way to do this? E.g. by adding a property to MANIFEST.MF or some such? |
Sure there is a minSdk="" in AndroidManifest.xml that exists for any Android module, apps or libraries. As a matter of fact I looked at https://github.com/googleapis/google-http-java-client/blob/master/google-http-client-android/AndroidManifest.xml and it shows this: It should read 14 and not 4. I suppose other libraries are affected the same way but I didn't check. No wonder there is no warning or error. |
…e-plugin to v3.0.0-m7 (googleapis#926) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.apache.maven.plugins:maven-surefire-plugin](https://maven.apache.org/surefire/) | `3.0.0-M6` -> `3.0.0-M7` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-surefire-plugin/3.0.0-M7/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-surefire-plugin/3.0.0-M7/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-surefire-plugin/3.0.0-M7/compatibility-slim/3.0.0-M6)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-surefire-plugin/3.0.0-M7/confidence-slim/3.0.0-M6)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/google-auth-library-java).
Environment details
Code example
private static List exeQ(String q) throws IOException {
String nextPageToken = "";
List res = new ArrayList<>();
do {
final FileList list = googleDriveService.files().list().setSpaces("drive").setQ(q).setPageToken(nextPageToken).setFields("nextPageToken, files(*)").setPageSize(100).setOrderBy("modifiedTime").execute();
nextPageToken = list.getNextPageToken();
res.addAll(list.getFiles());
} while (nextPageToken != null);
return res;
}
Stack trace
Thanks!
The text was updated successfully, but these errors were encountered: