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

后端 未结 6 687
無奈伤痛
無奈伤痛 2020-11-27 16:54

I\'m working on an app on Android. I\'m using httpcore 4.3.3. I get this when I try to use ContentType.parse(string)

java.lang.NoSuchFieldError:         


        
6条回答
  •  鱼传尺愫
    2020-11-27 17:24

    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'
    

提交回复
热议问题