jos*_*ick 27 android apache-httpclient-4.x androidhttpclient
我正在研究Android上的应用.我正在使用httpcore 4.3.3.我尝试使用时会得到这个ContentType.parse(string)
java.lang.NoSuchFieldError: No static field INSTANCE of type Lorg/apache/http/message/BasicHeaderValueParser; in class Lorg/apache/http/message/BasicHeaderValueParser; or its superclasses (declaration of 'org.apache.http.message.BasicHeaderValueParser' appears in /system/framework/ext.jar)
Run Code Online (Sandbox Code Playgroud)
我做了一些谷歌搜索,我理解为什么我得到错误,但我不确定如何解决它.从我读过的内容来看,似乎ContentType试图利用Android附带的BasicHeaderValueParser,而该类还没有INSTANCE字段.有什么帮助吗?
这些是相关的进口:
compile('org.apache.httpcomponents:httpmime:4.3.6') {
exclude module: 'httpclient'
}
compile 'org.apache.httpcomponents:httpcore:4.3.3'
Run Code Online (Sandbox Code Playgroud)
ok2*_*k2c 90
不幸的是,HttpCore的库存版本无法在Android中使用.请使用Apache HttpClient Android端口,其中还包括必需的HttpCore类
compile('org.apache.httpcomponents:httpmime:4.3.6') {
exclude module: 'httpclient'
}
compile 'org.apache.httpcomponents:httpclient-android:4.3.5'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
23843 次 |
| 最近记录: |