Getting NoSuchFieldError INSTANCE org/apache/http/message/BasicHeaderValueParser

我们两清 提交于 2019-11-26 20:17:19

Unfortunately stock versions of HttpCore cannot be used in Android. Please use Apache HttpClient Android Port which also includes requisite HttpCore classes

compile('org.apache.httpcomponents:httpmime:4.3.6') {
    exclude module: 'httpclient'
}
compile 'org.apache.httpcomponents:httpclient-android:4.3.5'

Download latest Apache Httpclient Jar file and refract path name. That works for me.

Looks like you use incompatible jar's for httpmime and httpclient-android. Try to use version 4.3.6 of httpmime

Simple solution is to use:

https://code.google.com/p/httpclientandroidlib/

It's the Appache HttpClient port for android wrap in a different package name so that will not interfere with the existing version in Android. Import the jar in the Android project and instead of "org.apache.http" use "ch.boye.httpclientandroidlib."

Just add httpmime_4.3.6.jar of version 4.3.6 file in lib folder and add

implementation files('lib/httpmime-4.3.6.jar') in gradle(app level)

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