J
J
Ja_Pasha2013-02-12 17:17:55
Android
Ja_Pasha, 2013-02-12 17:17:55

GoogleDrive API. Exception if app is signed with production key?

Hello!
I am using the Google Drive API in an application. Everything worked fine when the app was signed with a development key (debug.keystore). But when I signed the production key, a very strange problem arose.
This is the code to find and create folders on the drive:

com.google.api.services.drive.Drive.Files.List request = 
    service.files().list()
        .setQ("'" + folderId + "' in parents " +
            "and mimeType='application/vnd.google-apps.folder' " +
            "and trashed=false " +
            "and title='" + title + "'");
FileList files = request.execute();
if (files.getItems().size() == 0) {
    ParentReference parentReference = new ParentReference();
    parentReference.setId(folderId);
    parent.add(parentReference);
    File body = new File();
    body.setTitle(title);
    body.setMimeType("application/vnd.google-apps.folder");
    body.setParents(parent);
    File file = service.files().insert(body).execute();
    folderId = file.getId();
} else {
    folderId = files.getItems().get(0).getId();
}

FileList files = request.execute(); — the execute() method throws the following exception:
java.lang.IllegalArgumentException: unable to create new instance of class com.google.abaae because it has no accessible default constructor

Those. this part can no longer search or create folders. Let me remind you that this error appears only if the app is signed with the production key . With the debug key everything works fine.
Has anyone had a similar problem or have any idea what could be causing this behavior?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lopatoid, 2013-02-12
@Ja_Pasha

I would venture to suggest that the problem is related to Proguard (which does not start in the debug version).
Here a person has a similar problem: stackoverflow.com/questions/14410520/google-drive-api-doesnt-play-well-with-proguard-npe

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question