title: While adding OSMDroid library getting Error as Execution failed for task ':app:transformClassesWithDexForDebug'
body: <p>I have just started working with OSMDROID. And I used the basic code for OpenStreetMap implementation and I started getting the error: </p>
  
  <blockquote>
    <p>Execution failed for task ':app:transformClassesWithDexForDebug'.
    com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_25\bin\java.exe'' finished with non-zero exit value 1</p>
  </blockquote>
  
  <p>There were multiple fixes already for the error, but none fixed mine.</p>
  
  <p><strong>Here is my build.gradle</strong></p>
  
  <pre><code>   apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 23
      buildToolsVersion "24.0.0 rc1"
  
      defaultConfig {
          applicationId "com.appiva.ezmap"
          minSdkVersion 18
          targetSdkVersion 23
          multiDexEnabled true
  
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      testCompile 'junit:junit:4.12'
      compile 'com.android.support:appcompat-v7:23.2.1'
      compile files('libs/slf4j-android-1.5.8.jar')
      compile files('libs/osmdroid-android-4.0.jar')
  }
  </code></pre>
  
  <p><strong>AndroidManifest.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.appiva.ezmap"&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:supportsRtl="true"
          android:theme="@style/AppTheme"&gt;
  
      &gt;
  
  
          &lt;activity android:name=".MainActivity"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
  
          &lt;/activity&gt;
  
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p><strong>Gradle Console</strong></p>
  
  <pre><code>Executing tasks: [:app:clean, :app:generateDebugSources, :app:prepareDebugUnitTestDependencies, :app:mockableAndroidJar, :app:generateDebugAndroidTestSources, :app:assembleDebug]
  
  Configuration on demand is an incubating feature.
  Incremental java compilation is an incubating feature.
  :app:clean
  :app:preBuild UP-TO-DATE
  :app:preDebugBuild UP-TO-DATE
  :app:checkDebugManifest
  :app:preReleaseBuild UP-TO-DATE
  :app:prepareComAndroidSupportAnimatedVectorDrawable2321Library
  :app:prepareComAndroidSupportAppcompatV72321Library
  :app:prepareComAndroidSupportMultidex101Library
  :app:prepareComAndroidSupportSupportV42321Library
  :app:prepareComAndroidSupportSupportVectorDrawable2321Library
  :app:prepareDebugDependencies
  :app:compileDebugAidl
  :app:compileDebugRenderscript
  :app:generateDebugBuildConfig
  :app:generateDebugAssets UP-TO-DATE
  :app:mergeDebugAssets
  :app:generateDebugResValues UP-TO-DATE
  :app:generateDebugResources
  :app:mergeDebugResources
  Exception in thread "png-cruncher_163" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at C:\Users\acer\AppData\Local\Android\sdk3\build-tools\24.0.0-preview\aapt.exe can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
      at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
      at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
      at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
      at java.lang.Thread.run(Thread.java:724)
  Exception in thread "png-cruncher_173" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at C:\Users\acer\AppData\Local\Android\sdk3\build-tools\24.0.0-preview\aapt.exe can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
      at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
      at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
      at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
      at java.lang.Thread.run(Thread.java:724)
  Exception in thread "png-cruncher_172" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at C:\Users\acer\AppData\Local\Android\sdk3\build-tools\24.0.0-preview\aapt.exe can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
      at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
      at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
      at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
      at java.lang.Thread.run(Thread.java:724)
  
  :app:processDebugManifest
  :app:processDebugResources
  :app:generateDebugSources
  :app:preDebugUnitTestBuild UP-TO-DATE
  :app:prepareDebugUnitTestDependencies
  :app:mockableAndroidJar UP-TO-DATE
  :app:preDebugAndroidTestBuild UP-TO-DATE
  :app:prepareComAndroidSupportMultidexInstrumentation101Library
  :app:prepareDebugAndroidTestDependencies
  :app:compileDebugAndroidTestAidl
  :app:processDebugAndroidTestManifest
  :app:compileDebugAndroidTestRenderscript
  :app:generateDebugAndroidTestBuildConfig
  :app:generateDebugAndroidTestAssets UP-TO-DATE
  :app:mergeDebugAndroidTestAssets
  :app:generateDebugAndroidTestResValues UP-TO-DATE
  :app:generateDebugAndroidTestResources
  :app:mergeDebugAndroidTestResources
  :app:processDebugAndroidTestResources
  :app:generateDebugAndroidTestSources
  :app:compileDebugJavaWithJavac
  Note: C:\Users\acer\Desktop\Aprajeeta\Studies\android_work\ezMap\app\src\main\java\com\appiva\ezmap\MainActivity.java uses or overrides a deprecated API.
  Note: Recompile with -Xlint:deprecation for details.
  
  :app:compileDebugNdk UP-TO-DATE
  :app:compileDebugSources
  :app:buildInfoDebugLoader
  :app:transformClassesWithExtractJarsForDebug
  :app:transformClassesWithInstantRunVerifierForDebug
  :app:transformClassesWithJavaResourcesVerifierForDebug UP-TO-DATE
  :app:mergeDebugJniLibFolders
  :app:transformNative_libsWithMergeJniLibsForDebug
  :app:processDebugJavaRes UP-TO-DATE
  :app:transformResourcesWithMergeJavaResForDebug
  :app:transformResourcesAndNative_libsWithJavaResourcesVerifierForDebug UP-TO-DATE
  :app:transformClassesWithInstantRunForDebug
  :app:transformClasses_enhancedWithInstant+reloadDexForDebug UP-TO-DATE
  :app:incrementalDebugTasks
  :app:prePackageMarkerForDebug
  :app:coldswapKickerDebug
  :app:fastDeployDebugExtractor
  :app:generateDebugInstantRunAppInfo
  :app:transformClassesWithInstantRunSlicerForDebug
  :app:transformClassesWithDexForDebug
  AGPBI: {"kind":"error","text":"java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0","sources":[{}]}
  AGPBI: {"kind":"error","text":"java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.lang.ClassLoader.defineClass1(Native Method)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.lang.ClassLoader.defineClass1(Native Method)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.lang.ClassLoader.defineClass(ClassLoader.java:792)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.lang.ClassLoader.defineClass(ClassLoader.java:792)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.net.URLClassLoader.defineClass(URLClassLoader.java:449)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.net.URLClassLoader.defineClass(URLClassLoader.java:449)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.net.URLClassLoader.access$100(URLClassLoader.java:71)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.net.URLClassLoader.access$100(URLClassLoader.java:71)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.net.URLClassLoader$1.run(URLClassLoader.java:361)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.net.URLClassLoader$1.run(URLClassLoader.java:361)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.net.URLClassLoader$1.run(URLClassLoader.java:355)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.net.URLClassLoader$1.run(URLClassLoader.java:355)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.security.AccessController.doPrivileged(Native Method)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.security.AccessController.doPrivileged(Native Method)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.net.URLClassLoader.findClass(URLClassLoader.java:354)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.net.URLClassLoader.findClass(URLClassLoader.java:354)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.lang.ClassLoader.loadClass(ClassLoader.java:424)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.lang.ClassLoader.loadClass(ClassLoader.java:424)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.lang.ClassLoader.loadClass(ClassLoader.java:357)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.lang.ClassLoader.loadClass(ClassLoader.java:357)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)","sources":[{}]}
  AGPBI: {"kind":"error","text":"Exception in thread \"main\" ","sources":[{}]}
  AGPBI: {"kind":"error","text":"Exception in thread \"main\" ","sources":[{}]}
  
   FAILED
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':app:transformClassesWithDexForDebug'.
  &gt; com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_25\bin\java.exe'' finished with non-zero exit value 1
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  
  BUILD FAILED
  
  Total time: 1 mins 35.571 secs
  
  AGPBI: {"kind":"error","text":"java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.lang.ClassLoader.defineClass1(Native Method)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.lang.ClassLoader.defineClass(ClassLoader.java:792)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.net.URLClassLoader.defineClass(URLClassLoader.java:449)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.net.URLClassLoader.access$100(URLClassLoader.java:71)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.net.URLClassLoader$1.run(URLClassLoader.java:361)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.net.URLClassLoader$1.run(URLClassLoader.java:355)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.security.AccessController.doPrivileged(Native Method)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.net.URLClassLoader.findClass(URLClassLoader.java:354)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.lang.ClassLoader.loadClass(ClassLoader.java:424)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat java.lang.ClassLoader.loadClass(ClassLoader.java:357)","sources":[{}]}
  AGPBI: {"kind":"error","text":"\tat sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)","sources":[{}]}
  AGPBI: {"kind":"error","text":"Exception in thread \"main\" ","sources":[{}]}
  </code></pre>
  
  <p>I am very new to android, so error spotting and also how to rectify it shall be highly appreciated. Thanks in advance.</p>
  
  <p><strong>Gradle Console after EDIT</strong></p>
  
  <pre><code>Executing tasks: [:app:generateDebugSources, :app:prepareDebugUnitTestDependencies, :app:mockableAndroidJar, :app:generateDebugAndroidTestSources]
  
  Configuration on demand is an incubating feature.
  Incremental java compilation is an incubating feature.
  :app:preBuild UP-TO-DATE
  :app:preDebugBuild UP-TO-DATE
  :app:checkDebugManifest
  :app:preReleaseBuild UP-TO-DATE
  :app:prepareComAndroidSupportAnimatedVectorDrawable2321Library UP-TO-DATE
  :app:prepareComAndroidSupportAppcompatV72321Library UP-TO-DATE
  :app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
  :app:prepareComAndroidSupportSupportV42321Library UP-TO-DATE
  :app:prepareComAndroidSupportSupportVectorDrawable2321Library UP-TO-DATE
  :app:prepareDebugDependencies
  :app:compileDebugAidl UP-TO-DATE
  :app:compileDebugRenderscript UP-TO-DATE
  :app:generateDebugBuildConfig UP-TO-DATE
  :app:generateDebugAssets UP-TO-DATE
  :app:mergeDebugAssets UP-TO-DATE
  :app:generateDebugResValues UP-TO-DATE
  :app:generateDebugResources UP-TO-DATE
  :app:mergeDebugResources UP-TO-DATE
  :app:processDebugManifest
  :app:processDebugResources
  :app:generateDebugSources
  :app:preDebugUnitTestBuild UP-TO-DATE
  :app:prepareDebugUnitTestDependencies
  :app:mockableAndroidJar UP-TO-DATE
  :app:preDebugAndroidTestBuild UP-TO-DATE
  :app:prepareComAndroidSupportMultidexInstrumentation101Library UP-TO-DATE
  :app:prepareDebugAndroidTestDependencies
  :app:compileDebugAndroidTestAidl UP-TO-DATE
  :app:processDebugAndroidTestManifest UP-TO-DATE
  :app:compileDebugAndroidTestRenderscript UP-TO-DATE
  :app:generateDebugAndroidTestBuildConfig UP-TO-DATE
  :app:generateDebugAndroidTestAssets UP-TO-DATE
  :app:mergeDebugAndroidTestAssets UP-TO-DATE
  :app:generateDebugAndroidTestResValues UP-TO-DATE
  :app:generateDebugAndroidTestResources UP-TO-DATE
  :app:mergeDebugAndroidTestResources UP-TO-DATE
  :app:processDebugAndroidTestResources
  :app:generateDebugAndroidTestSources
  
  BUILD SUCCESSFUL
  
  Total time: 16.562 secs
  Executing tasks: [:app:clean, :app:generateDebugSources, :app:prepareDebugUnitTestDependencies, :app:mockableAndroidJar, :app:generateDebugAndroidTestSources, :app:assembleDebug]
  
  Configuration on demand is an incubating feature.
  Incremental java compilation is an incubating feature.
  :app:clean
  :app:preBuild UP-TO-DATE
  :app:preDebugBuild UP-TO-DATE
  :app:checkDebugManifest
  :app:preReleaseBuild UP-TO-DATE
  :app:prepareComAndroidSupportAnimatedVectorDrawable2321Library
  :app:prepareComAndroidSupportAppcompatV72321Library
  :app:prepareComAndroidSupportMultidex101Library
  :app:prepareComAndroidSupportSupportV42321Library
  :app:prepareComAndroidSupportSupportVectorDrawable2321Library
  :app:prepareDebugDependencies
  :app:compileDebugAidl
  :app:compileDebugRenderscript
  :app:generateDebugBuildConfig
  :app:generateDebugAssets UP-TO-DATE
  :app:mergeDebugAssets
  :app:generateDebugResValues UP-TO-DATE
  :app:generateDebugResources
  :app:mergeDebugResources
  :app:processDebugManifest
  :app:processDebugResources
  :app:generateDebugSources
  :app:preDebugUnitTestBuild UP-TO-DATE
  :app:prepareDebugUnitTestDependencies
  :app:mockableAndroidJar UP-TO-DATE
  :app:preDebugAndroidTestBuild UP-TO-DATE
  :app:prepareComAndroidSupportMultidexInstrumentation101Library
  :app:prepareDebugAndroidTestDependencies
  :app:compileDebugAndroidTestAidl
  :app:processDebugAndroidTestManifest
  :app:compileDebugAndroidTestRenderscript
  :app:generateDebugAndroidTestBuildConfig
  :app:generateDebugAndroidTestAssets UP-TO-DATE
  :app:mergeDebugAndroidTestAssets
  :app:generateDebugAndroidTestResValues UP-TO-DATE
  :app:generateDebugAndroidTestResources
  :app:mergeDebugAndroidTestResources
  :app:processDebugAndroidTestResources
  :app:generateDebugAndroidTestSources
  :app:compileDebugJavaWithJavac
  Note: C:\Users\acer\Desktop\Aprajeeta\Studies\android_work\ezMap\app\src\main\java\com\appiva\ezmap\MainActivity.java uses or overrides a deprecated API.
  Note: Recompile with -Xlint:deprecation for details.
  
  :app:compileDebugNdk UP-TO-DATE
  :app:compileDebugSources
  :app:buildInfoDebugLoader
  :app:transformClassesWithExtractJarsForDebug
  :app:transformClassesWithInstantRunVerifierForDebug
  :app:transformClassesWithJavaResourcesVerifierForDebug UP-TO-DATE
  :app:mergeDebugJniLibFolders
  :app:transformNative_libsWithMergeJniLibsForDebug
  :app:processDebugJavaRes UP-TO-DATE
  :app:transformResourcesWithMergeJavaResForDebug
  :app:transformResourcesAndNative_libsWithJavaResourcesVerifierForDebug
  :app:transformClassesWithInstantRunForDebug
  :app:transformClasses_enhancedWithInstant+reloadDexForDebug
  :app:incrementalDebugTasks
  :app:prePackageMarkerForDebug
  :app:coldswapKickerDebug
  :app:fastDeployDebugExtractor
  :app:generateDebugInstantRunAppInfo
  :app:transformClassesWithInstantRunSlicerForDebug
  :app:transformClassesWithDexForDebug
  AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]}
  AGPBI: {"kind":"error","text":"(org.slf4j.impl.SimpleLogger$1) that doesn\u0027t come with an","sources":[{}]}
  AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]}
  AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]}
  AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]}
  AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]}
  AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]}
  AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]}
  
  :app:validateDebugSigning
  :app:packageDebug
  :app:zipalignDebug
  :app:fullDebugBuildInfoGenerator
  :app:assembleDebug
  
  BUILD SUCCESSFUL
  
  Total time: 2 mins 34.496 secs
  </code></pre>