java.lang.NoSuchFieldError: org.apache.http.message.BasicLineFormatter.INSTANCE

前端 未结 2 1849
醉酒成梦
醉酒成梦 2020-12-16 04:42

Good day!

I need help!

I develop app for android with integration the IIS(SharePoint). And when i run this code(Code 2), i get ERROR

相关标签:
2条回答
  • 2020-12-16 05:26

    Google Android ships with an extremely outdated (pre BETA 4.0) fork of Apache HttpClient. Due to the presence of old classes on the classpath the stock version of HttpClient fails to initialize correctly unless all classes are moved to another namespace ('org.apache.http' -> 'thank.you.google.http')

    One way of making sure the stock version of Apache HttpClient does not overlap with its original namespace is repackaging it with the Maven Shade plugin, use the port developed by Dirk Boye, or the official port of Apache HttpClient to Google Android.

    0 讨论(0)
  • 2020-12-16 05:36

    For android remove all httpclient and httpcore dependencies and add

    compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'    // gradle depedencies
    

    in your build.gradle file

    0 讨论(0)
提交回复
热议问题