问题描述
我工作的一个Android应用程序,这是会一些文件上传到谷歌云存储。要,我使用的的JetS3t Java工具包0.9 做到这一点。我试图用它在标准的Java项目和工作正常,但是当我想用它的 Android版的项目,我发现了一个例外。
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.
我实例化的JetS3t谷歌存储服务时,像这样遇到的问题:
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();
我已经尝试了一堆东西,我在网上看到,如添加的HttpCore-4.1和的HttpClient 4.1罐子到classpath中,不过是无用的。
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!
推荐答案
在Android上使用Basically..don't ...的JetS3t这里是我的发现:
Basically..don't use JetS3t on Android...here's what I found:https://groups.google.com/forum/#!topic/jets3t-users/vCq4pwXSPN8
这篇关于IncompatibleClassChangeError异常Android上使用的JetS3t时抛出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!