IncompatibleClassChangeError exception is thrown when using JetS3t on Android

风流意气都作罢 提交于 2019-12-10 19:45:36

问题


I'm working on an Android application, which is going to upload some files to Google Cloud Storage. To do this, I'm using JetS3t java toolkit 0.9. I tried to use it on standard Java project and worked fine, but when I want to use it on Android project, I'm getting an exception.

I'm having the problem when instantiating a JetS3t Google Storage Service, like this:

GoogleStorageService gsService = new GoogleStorageService(gsCredentials);

The exception I'm getting when this line is executed is this one:

FATAL EXCEPTION: main
java.lang.IncompatibleClassChangeError: org.apache.http.params.SyncBasicHttpParams
    at org.jets3t.service.utils.RestUtils.createDefaultHttpParams(RestUtils.java:574)
    at org.jets3t.service.utils.RestUtils.initHttpConnection(RestUtils.java:298)
    at org.jets3t.service.impl.rest.httpclient.RestStorageService.initHttpConnection(RestStorageService.java:209)
    at org.jets3t.service.impl.rest.httpclient.RestStorageService.initializeDefaults(RestStorageService.java:166)
    at org.jets3t.service.StorageService.<init>(StorageService.java:125)
    at org.jets3t.service.impl.rest.httpclient.RestStorageService.<init>(RestStorageService.java:153)
    at org.jets3t.service.impl.rest.httpclient.GoogleStorageService.<init>(GoogleStorageService.java:125)
    at org.jets3t.service.impl.rest.httpclient.GoogleStorageService.<init>(GoogleStorageService.java:100)
    at org.jets3t.service.impl.rest.httpclient.GoogleStorageService.<init>(GoogleStorageService.java:78)

Looking at the exception thrown, the final error is exactly at this line:

HttpParams params = new SyncBasicHttpParams();

I've tried a bunch of things I saw on the Internet, like adding httpcore-4.1 and httpclient-4.1 jars to the classpath, but was useless.

Very grateful if someone help me! Thanks!


回答1:


Basically..don't use JetS3t on Android...here's what I found: https://groups.google.com/forum/#!topic/jets3t-users/vCq4pwXSPN8



来源:https://stackoverflow.com/questions/16799352/incompatibleclasschangeerror-exception-is-thrown-when-using-jets3t-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!