GeezerVison is showing github.com — Blob creation fails when deploying in an Android device · Issue #995 · googleapis/google-cloud-java
Blob creation fails when deploying in an Android device #995DescriptionHello,
Trying to deploy this snippet code into an Android device, I got the a NoSuchMethodError run-time exception saying that crc32c() static method does not exist in class com.google.common.hash.Hashing.
The exception is thrown at line where the blob is created:
Blob blob = storage.create(blobInfo, "Hello, Cloud Storage!".getBytes(UTF_8));
The whole Android code here.
Any suggestion would be appreciated. Activitymziccard commented on May 9, 2016 Hi @rafaelsf80,
it seems that an older version of guava is being deployed... This is strange... Try adding an explicit exclusion:
exclude group: 'com.google.guava', module: 'guava-jdk5' rafaelsf80 commented on May 9, 2016 Hi @mziccard
Thanks for your answer, I added this as suggested, but unfortunately still same error related to crc32c static method:
compile ('com.google.cloud:gcloud-java-storage:0.2.1') {
exclude group: 'com.google.api-client', module: 'google-api-client-appengine'
exclude group: 'com.google.guava', module: 'guava-jdk5'
}
compile 'com.google.apis:google-api-services-storage:v1beta1-rev131-1.22.0'mziccard commented on May 9, 2016 Try this:
compile ('com.google.cloud:gcloud-java-storage:0.2.1') {
exclude group: 'com.google.api-client', module: 'google-api-client-appengine'
exclude group: 'com.google.guava', module: 'guava-jdk5'
}
compile ('com.google.apis:google-api-services-storage:v1beta1-rev131-1.22.0') {
exclude group: 'com.google.guava', module: 'guava-jdk5'
}
rafaelsf80 commented on May 9, 2016 Thanks again for your quick answer. Unfortunately, the problem remains with the same exception at run-time, related to the crc32c method. Thanks. mziccard commented on May 9, 2016 Could you double check? Maybe cleaning the build first? I've just tried and I managed to create the blob. rafaelsf80 commented on May 9, 2016 sorry, thanks, my mistake. It worked :)
Thanks for your quick help mziccard commented on May 9, 2016
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|