title: Gradle - Multiple Dex ConnectedInstrumentTest
body: <p>I have a jar in lib folder and added this lib as File dependency.</p>
  
  <p>Generating build with <code>./gradlew build</code> is successful.</p>
  
  <p>But <code>./gradlew connectedInstrumentTest</code> is showing Multiple dex error for that jar added in lib folder.</p>
  
  <p>suggest me what is going wrong here.</p>
  
  <p><strong><em>build.gradle</em></strong></p>
  
  <pre><code>apply plugin: 'android-library'
  
  dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
  }
  
  
  android {
      compileSdkVersion 17
      buildToolsVersion "17.0.0"
  
      sourceSets {
          main {
              manifest.srcFile 'AndroidManifest.xml'
              java.srcDirs = ['src']
              resources.srcDirs = ['src']
              aidl.srcDirs = ['src']
              renderscript.srcDirs = ['src']
              res.srcDirs = ['res']
              assets.srcDirs = ['assets']
          }
  
  
  
          // Move the tests to tests/java, tests/res, etc...
          instrumentTest.setRoot('tests')
  
          // Move the build types to build-types/&lt;type&gt;
          // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
          // This moves them out of them default location under src/&lt;type&gt;/... which would
          // conflict with src/ being used by the main source set.
          // Adding new build types or product flavors should be accompanied
          // by a similar customization.
          debug.setRoot('build-types/debug')
          release.setRoot('build-types/release')
  
      }
  }
  </code></pre>
  
  <p><strong><em>Module Dependency:</em></strong></p>
  
  <p><img src="https://i.stack.imgur.com/nOm0P.png" alt="enter image description here"></p>
  
  <p><strong><em>lib folder in project:</em></strong></p>
  
  <p><img src="https://i.stack.imgur.com/S5ZhX.png" alt="enter image description here"></p>