title: Android Issues with Apache http client android library
body: <p>This is the library that I'm using:
  <a href="https://github.com/clickntap/Vimeo" rel="nofollow noreferrer">https://github.com/clickntap/Vimeo</a></p>
  
  <p>I'm trying to use the library for an Android app. My test device is Kitkat (4.4.4).</p>
  
  <p>Here's my gradle config:</p>
  
  <pre><code>compileSdkVersion 25
  buildToolsVersion "25.0.3"
  useLibrary  'org.apache.http.legacy'
  
  defaultConfig {
      applicationId "my.app.package"
      minSdkVersion 16
      targetSdkVersion 25
      versionCode 1
      versionName "1.0.0-alpha"
  }
  </code></pre>
  
  <p>Here's how I added the library:</p>
  
  <pre><code>compile 'com.clickntap:vimeo:1.10'
  </code></pre>
  
  <p>But I receive the following error on <code>Vimeo.addVideo()</code>:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: org.apache.http.impl.client.HttpClientBuilder
  </code></pre>
  
  <p>and warnings:</p>
  
  <pre><code>WARNING: Dependency org.apache.httpcomponents:httpclient:4.3.6 is ignored for debug as it may be conflicting with the internal version provided by Android.
  WARNING: Dependency org.json:json:20140107 is ignored for debug as it may be conflicting with the internal version provided by Android.
  </code></pre>
  
  <p>So I searched a little and found that I could do something like this:</p>
  
  <pre><code>compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
  compile('com.clickntap:vimeo:1.10') {
      exclude group: 'org.apache.httpcomponents'
      exclude group: 'org.json'
  }
  </code></pre>
  
  <p>But now I'm receiving this error still on <code>Vimeo.addVideo()</code> and can't find any solution:</p>
  
  <pre><code>java.lang.NoSuchMethodError: org.apache.http.entity.FileEntity.&lt;init&gt;
  </code></pre>
  
  <p>Please help :(</p>
  
  <p>Thanks,</p>
  
  <p>P.S.
  Here's the stack trace for the 1st scenario:</p>
  
  <pre><code>Caused by: java.lang.NoClassDefFoundError: org.apache.http.impl.client.HttpClientBuilder
                  at com.clickntap.vimeo.Vimeo.apiRequest(Vimeo.java:218)
                  at com.clickntap.vimeo.Vimeo.beginUploadVideo(Vimeo.java:122)
                  at com.clickntap.vimeo.Vimeo.addVideo(Vimeo.java:138)
                  at my.app.package.VimeoActivity$6.subscribe(VimeoActivity.java:163) // my activity
                  at io.reactivex.internal.operators.single.SingleCreate.subscribeActual(SingleCreate.java:39)
                  at io.reactivex.Single.subscribe(Single.java:2702)
                  at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
                  at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:451)
                  at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61)
                  at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52) 
                  at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
                  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152) 
                  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265) 
                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
                  at java.lang.Thread.run(Thread.java:841) 
  </code></pre>
  
  <p>And here's for the 2nd scenario, where the <code>httpclient-android</code> is included:</p>
  
  <pre><code>Caused by: java.lang.NoSuchMethodError: org.apache.http.entity.FileEntity.&lt;init&gt;
                  at com.clickntap.vimeo.Vimeo.apiRequest(Vimeo.java:247)
                  at com.clickntap.vimeo.Vimeo.uploadVideo(Vimeo.java:126)
                  at com.clickntap.vimeo.Vimeo.addVideo(Vimeo.java:140)
                  at my.app.package.VimeoActivity$6.subscribe(VimeoActivity.java:163) // my activity
                  at io.reactivex.internal.operators.single.SingleCreate.subscribeActual(SingleCreate.java:39)
                  at io.reactivex.Single.subscribe(Single.java:2702)
                  at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
                  at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:451)
                  at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61)
                  at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52) 
                  at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
                  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152) 
                  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265) 
                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
                  at java.lang.Thread.run(Thread.java:841) 
  </code></pre>