title: Multiple dex files define Lorg/apache/http/HttpConnection with Gradle and Android Studio
body: <p><strong>Development environment</strong>:</p>
  
  <ul>
  <li>OS: Windows 7</li>
  <li>JDK: 1.8.0_66</li>
  <li>Android Studio: 1.5, built Nov. 12 2015</li>
  <li>Gradle: v2.8</li>
  </ul>
  
  <p><strong>build.gradle</strong></p>
  
  <p><a href="https://i.stack.imgur.com/HgxSn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HgxSn.png" alt="enter image description here"></a></p>
  
  <p><strong><code>libs</code> folder</strong></p>
  
  <p><a href="https://i.stack.imgur.com/rkIcU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rkIcU.png" alt="enter image description here"></a></p>
  
  <p><strong>Project Structure</strong></p>
  
  <p><a href="https://i.stack.imgur.com/kFSpd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kFSpd.png" alt="enter image description here"></a></p>
  
  <p><strong>Exception</strong></p>
  
  <p><code>UNEXPECTED TOP-LEVEL EXCEPTION:
  com.android.dex.DexException: Multiple dex files define Lorg/apache/http/HttpConnection;</code></p>
  
  <p>Stuck with this issue for the past two days. Understood that there are multiple definitions of that class in the dependencies, but clueless on the fix. Was unable to get any of the answers on this topic to work. </p>
  
  <p>On <code>Eclipse</code> this project / module runs without any issues. This is my first shot at Gradle on Android Studio. So,: </p>
  
  <p><li>Is there a specific Android-Gradle plugin (or similar) that needs to be installed? 
  <li>Adding <code>dexOptions { preDexLibraries = false }</code> also fails: 
  <code>Error:(11, 0) Gradle DSL method not found: 'dexOptions()' Possible causes: The project 'XXX' may be using a version of Gradle that does not contain the method.</code>
  <li>Any glaring error in the way things are setup here? </p>