title: Android Studio Build fail - Execution failed for task ':app:dexDebug'
body: <p>I am a new Android Developer and build files always scare me. :D
  I am using some third part libraries in the project</p>
  
  <pre><code>dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
      compile 'com.android.support:appcompat-v7:21.0.+'
      compile 'com.android.support:support-v4:21.0.3'
      compile 'com.android.support:cardview-v7:21.0.+'
      compile 'com.android.support:recyclerview-v7:21.0.+'
      compile 'de.hdodenhof:circleimageview:1.2.1'
      compile 'com.github.flavienlaurent.datetimepicker:library:0.0.2'
  }
  </code></pre>
  
  <p>In addition to this I am also using MPAndroidChart(the only jar in the lib folder) which is only available as a jar file and not a gradle dependency. </p>
  
  <p>MPAndroidChart uses NineOldAndroids as a dependency and I suspect one of my other libraries also uses it and it is causing a build fail.</p>
  
  <p>Any idea how to make both these libraries behave?</p>
  
  <p>I checked the similar questions and found one that was exactly my problem-
  <a href="https://stackoverflow.com/questions/27675717/gradle-error-execution-failed-for-task-appdexdebug">Gradle error - Execution failed for task &#39;:app:dexDebug&#39;</a></p>
  
  <p>But he was including the NineOldAndroids library on his own. So he just removed that line and it was working. </p>
  
  <p>One idea that I had was to strip apart the jar and include them as java files in my project, but that seemed like overkill for this problem. I'm sure there must be an easier way? </p>
  
  <p>This is my entire error </p>
  
  <pre><code>UNEXPECTED TOP-LEVEL EXCEPTION:
  com.android.dex.DexException: Multiple dex files define Lcom/nineoldandroids/animation/ValueAnimator$AnimatorUpdateListener;
      at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
      at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
      at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
      at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
      at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
      at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
      at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
      at com.android.dx.command.dexer.Main.run(Main.java:246)
      at com.android.dx.command.dexer.Main.main(Main.java:215)
      at com.android.dx.command.Main.main(Main.java:106)
  
  
   FAILED
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':app:dexDebug'.
  &gt; com.android.ide.common.internal.LoggedErrorException: Failed to run command:
      C:\Users\manu.joseph\AppData\Local\Android\sdk\build-tools\21.1.2\dx.bat --dex --no-optimize --output C:\Users\manu.joseph\AndroidStudioProjects\WriteTrack\app\build\intermediates\dex\debug --input-list=C:\Users\manu.joseph\AndroidStudioProjects\WriteTrack\app\build\intermediates\tmp\dex\debug\inputList.txt
  Error Code:
      2
  Output:
  
      UNEXPECTED TOP-LEVEL EXCEPTION:
      com.android.dex.DexException: Multiple dex files define Lcom/nineoldandroids/animation/ValueAnimator$AnimatorUpdateListener;
          at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
          at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
          at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
          at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
          at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
          at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
          at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
          at com.android.dx.command.dexer.Main.run(Main.java:246)
          at com.android.dx.command.dexer.Main.main(Main.java:215)
          at com.android.dx.command.Main.main(Main.java:106)
  </code></pre>