Skip to content

Api 19 Caused by: java.lang.NoClassDefFoundError: java.nio.charset.StandardCharsets #926

Description

@Zevsus

Environment details

  1. OS type and version: Android api 19
  2. Java version: 8
  3. google-http-client version(s): implementation 'com.google.http-client:google-http-client-gson:1.34.0'

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

     Caused by: java.lang.NoClassDefFoundError: java.nio.charset.StandardCharsets
        at com.google.api.client.util.escape.CharEscapers.decodeUriPath(CharEscapers.java:110)
        at com.google.api.client.http.GenericUrl.toPathParts(GenericUrl.java:594)
        at com.google.api.client.http.GenericUrl.<init>(GenericUrl.java:200)
        at com.google.api.client.http.GenericUrl.<init>(GenericUrl.java:177)
        at com.google.api.client.http.GenericUrl.<init>(GenericUrl.java:126)
        at com.google.api.client.http.GenericUrl.<init>(GenericUrl.java:109)
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequestUrl(AbstractGoogleClientRequest.java:388)
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequest(AbstractGoogleClientRequest.java:423)
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:542)
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:475)
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:592)
        (GFile.java:192)

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

needs more infoThis issue needs more information from the customer to proceed.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions