Android - MultipartEntity and dependencies

前端 未结 4 367
臣服心动
臣服心动 2020-12-03 13:56

I recently migrate my project from Eclipse to Android Studio (I do not fully control this IDE yet). In this project, I have a file uploader AsyncTask which send multipart ov

相关标签:
4条回答
  • 2020-12-03 14:31

    I had the same issue - try to use the http-android-client (this also relies on the httmime but requires 4.3). This worked for me:

    dependencies {
      compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'
      compile('org.apache.httpcomponents:httpmime:4.3') {
          exclude module: "httpclient"
      }
    }
    
    0 讨论(0)
  • 2020-12-03 14:36
    compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'
    compile('org.apache.httpcomponents:httpmime:4.3') {
        // httpmime:4.2.1'  also worked 
        exclude module: "httpclient"
    }
    
    0 讨论(0)
  • 2020-12-03 14:39

    Solution for Android Studio

    Right click on app foleder in left- >Open Module Settings -> Dependencies-> click '+' -> 1. library Dependencie

    now "choose file Dependencies" box will come - provide input 'httpmime:4.4' and click search button.

    it will show the dependencie file. Select that file and click ok.

    wait ... it will add the jar and Gradle script will be updated automatically.

    0 讨论(0)
  • 2020-12-03 14:46
    dependencies {
     compile('org.apache.httpcomponents:httpmime:4.3') {
        exclude module: "httpclient"
    }
    
    0 讨论(0)
提交回复
热议问题