title: ProcessException: org.gradle.process.internal.ExecException finished with non-zero exit value 2
body: <p>today i faced with this <strong>build error</strong> after trying to build my project, but i have changed nothing, it just popped from nowhere... or i simply don't remember what i have changed. I did one thing, updated build tools but i simply don't use the latest so it should bother the project.</p>
  
  <p>Error:</p>
  
  <pre><code>Error:Execution failed for task ':DoToDoCourierApp:transformClassesWithDexForDebug'.
  &gt; com.android.build.transform.api.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 2
  </code></pre>
  
  <p>Full log:</p>
  
  <pre><code>Information:Gradle tasks [:DoToDoCourierApp:generateDebugSources, :DoToDoCourierApp:generateDebugAndroidTestSources, :DoToDoCourierApp:assembleDebug]
  :DoToDoCourierApp:preBuild UP-TO-DATE
  :DoToDoCourierApp:preDebugBuild UP-TO-DATE
  :DoToDoCourierApp:checkDebugManifest
  :DoToDoCourierApp:preReleaseBuild UP-TO-DATE
  :DoToDoEssentials:preBuild UP-TO-DATE
  :DoToDoEssentials:preReleaseBuild UP-TO-DATE
  :DoToDoEssentials:compileReleaseNdk UP-TO-DATE
  :DoToDoEssentials:compileLint
  :DoToDoEssentials:copyReleaseLint UP-TO-DATE
  :DoToDoEssentials:checkReleaseManifest
  :DoToDoEssentials:preDebugAndroidTestBuild UP-TO-DATE
  :DoToDoEssentials:preDebugBuild UP-TO-DATE
  :DoToDoEssentials:preDebugUnitTestBuild UP-TO-DATE
  :DoToDoEssentials:preReleaseUnitTestBuild UP-TO-DATE
  :DoToDoEssentials:prepareComAndroidSupportAppcompatV72310Library UP-TO-DATE
  :DoToDoEssentials:prepareComAndroidSupportDesign2310Library UP-TO-DATE
  :DoToDoEssentials:prepareComAndroidSupportMediarouterV72220Library UP-TO-DATE
  :DoToDoEssentials:prepareComAndroidSupportRecyclerviewV72310Library UP-TO-DATE
  :DoToDoEssentials:prepareComAndroidSupportSupportV132310Library UP-TO-DATE
  :DoToDoEssentials:prepareComAndroidSupportSupportV42310Library UP-TO-DATE
  :DoToDoEssentials:prepareComFacebookAndroidFacebookAndroidSdk460Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServices810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesAds810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesAnalytics810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesAppindexing810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesAppinvite810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesAppstate810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesBase810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesBasement810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesCast810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesDrive810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesFitness810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesGames810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesGcm810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesIdentity810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesLocation810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesMaps810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesMeasurement810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesNearby810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesPanorama810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesPlus810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesSafetynet810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesVision810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesWallet810Library UP-TO-DATE
  :DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesWearable810Library UP-TO-DATE
  :DoToDoEssentials:prepareDeHdodenhofCircleimageview200Library UP-TO-DATE
  :DoToDoEssentials:prepareReleaseDependencies
  :DoToDoEssentials:compileReleaseAidl UP-TO-DATE
  :DoToDoEssentials:compileReleaseRenderscript UP-TO-DATE
  :DoToDoEssentials:generateReleaseBuildConfig UP-TO-DATE
  :DoToDoEssentials:generateReleaseAssets UP-TO-DATE
  :DoToDoEssentials:mergeReleaseAssets UP-TO-DATE
  :DoToDoEssentials:generateReleaseResValues UP-TO-DATE
  :DoToDoEssentials:generateReleaseResources UP-TO-DATE
  :DoToDoEssentials:mergeReleaseResources
  AAPT err(Facade for 1745997574): C:\android_studio_works\DoToDo_as\DoToDoEssentials\src\main\res\drawable-xhdpi\avatar_blank.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
  AAPT err(Facade for 967998735): C:\android_studio_works\DoToDo_as\DoToDoEssentials\src\main\res\drawable-xhdpi\logo_login.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
  AAPT err(Facade for 1796841709): C:\android_studio_works\DoToDo_as\DoToDoEssentials\src\main\res\drawable-xhdpi\car_avatar_blank.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
  AAPT err(Facade for 1504354275): C:\android_studio_works\DoToDo_as\DoToDoEssentials\src\main\res\drawable\login_splash.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
  :DoToDoEssentials:processReleaseManifest UP-TO-DATE
  :DoToDoEssentials:processReleaseResources UP-TO-DATE
  :DoToDoEssentials:generateReleaseSources UP-TO-DATE
  :DoToDoEssentials:compileReleaseJavaWithJavac UP-TO-DATE
  :DoToDoEssentials:extractReleaseAnnotations UP-TO-DATE
  :DoToDoEssentials:mergeReleaseProguardFiles UP-TO-DATE
  :DoToDoEssentials:processReleaseJavaRes UP-TO-DATE
  :DoToDoEssentials:packageReleaseJar UP-TO-DATE
  :DoToDoEssentials:packageReleaseJniLibs UP-TO-DATE
  :DoToDoEssentials:packageReleaseLocalJar UP-TO-DATE
  :DoToDoEssentials:packageReleaseRenderscript UP-TO-DATE
  :DoToDoEssentials:packageReleaseResources
  :DoToDoEssentials:bundleRelease UP-TO-DATE
  :DoToDoCourierApp:prepareComAndroidSupportAppcompatV72310Library UP-TO-DATE
  :DoToDoCourierApp:prepareComAndroidSupportDesign2310Library UP-TO-DATE
  :DoToDoCourierApp:prepareComAndroidSupportMediarouterV72220Library UP-TO-DATE
  :DoToDoCourierApp:prepareComAndroidSupportRecyclerviewV72310Library UP-TO-DATE
  :DoToDoCourierApp:prepareComAndroidSupportSupportV132310Library UP-TO-DATE
  :DoToDoCourierApp:prepareComAndroidSupportSupportV42310Library UP-TO-DATE
  :DoToDoCourierApp:prepareComFacebookAndroidFacebookAndroidSdk460Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServices810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesAds810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesAnalytics810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesAppindexing810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesAppinvite810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesAppstate810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesBase810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesBasement810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesCast810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesDrive810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesFitness810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesGames810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesGcm810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesIdentity810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesLocation810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesMaps810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesMeasurement810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesNearby810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesPanorama810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesPlus810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesSafetynet810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesVision810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesWallet810Library UP-TO-DATE
  :DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesWearable810Library UP-TO-DATE
  :DoToDoCourierApp:prepareDeHdodenhofCircleimageview200Library UP-TO-DATE
  :DoToDoCourierApp:prepareDoToDo_asDoToDoEssentialsUnspecifiedLibrary UP-TO-DATE
  :DoToDoCourierApp:prepareDebugDependencies
  :DoToDoCourierApp:compileDebugAidl UP-TO-DATE
  :DoToDoCourierApp:compileDebugRenderscript UP-TO-DATE
  :DoToDoCourierApp:generateDebugBuildConfig UP-TO-DATE
  :DoToDoCourierApp:generateDebugAssets UP-TO-DATE
  :DoToDoCourierApp:mergeDebugAssets UP-TO-DATE
  :DoToDoCourierApp:generateDebugResValues UP-TO-DATE
  :DoToDoCourierApp:processDebugGoogleServices
  :DoToDoCourierApp:generateDebugResources
  :DoToDoCourierApp:mergeDebugResources UP-TO-DATE
  :DoToDoCourierApp:processDebugManifest UP-TO-DATE
  :DoToDoCourierApp:processDebugResources UP-TO-DATE
  :DoToDoCourierApp:generateDebugSources UP-TO-DATE
  :DoToDoCourierApp:preDebugAndroidTestBuild UP-TO-DATE
  :DoToDoCourierApp:prepareDebugAndroidTestDependencies
  :DoToDoCourierApp:compileDebugAndroidTestAidl UP-TO-DATE
  :DoToDoCourierApp:processDebugAndroidTestManifest UP-TO-DATE
  :DoToDoCourierApp:compileDebugAndroidTestRenderscript UP-TO-DATE
  :DoToDoCourierApp:generateDebugAndroidTestBuildConfig UP-TO-DATE
  :DoToDoCourierApp:generateDebugAndroidTestAssets UP-TO-DATE
  :DoToDoCourierApp:mergeDebugAndroidTestAssets UP-TO-DATE
  :DoToDoCourierApp:generateDebugAndroidTestResValues UP-TO-DATE
  :DoToDoCourierApp:generateDebugAndroidTestResources UP-TO-DATE
  :DoToDoCourierApp:mergeDebugAndroidTestResources UP-TO-DATE
  :DoToDoCourierApp:processDebugAndroidTestResources UP-TO-DATE
  :DoToDoCourierApp:generateDebugAndroidTestSources UP-TO-DATE
  :DoToDoCourierApp:compileDebugJavaWithJavac UP-TO-DATE
  :DoToDoCourierApp:compileDebugNdk UP-TO-DATE
  :DoToDoCourierApp:compileDebugSources UP-TO-DATE
  :DoToDoCourierApp:transformClassesAndResourcesWithExtractJarsForDebug UP-TO-DATE
  :DoToDoCourierApp:transformClassesWithDexForDebug
  UNEXPECTED TOP-LEVEL EXCEPTION:
  Error:Execution failed for task ':DoToDoCourierApp:transformClassesWithDexForDebug'.
  &gt; com.android.build.transform.api.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 2
  </code></pre>
  
  <p><strong>I got 3 modules.</strong> In the first one is basically a library 'holder' it contains all the compiled libs. The 2 other are 2 application which uses the libraries.</p>
  
  <ul>
  <li>DoToDoEssentials: library module, containing all the compiled libs</li>
  <li>DoToDoCourier: App module</li>
  <li>DoToDoSender: App module</li>
  </ul>
  
  <p><strong>Here are the gradle files:</strong></p>
  
  <p><strong>Top level build.gradle for project:</strong></p>
  
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  
  buildscript {
      repositories {
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:1.3.1'
          classpath 'com.google.gms:google-services:1.4.0-beta3'
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  
  }
  
  allprojects {
      repositories {
          jcenter()
      }
  }
  </code></pre>
  
  <p><strong>DoToDoEssentials module gradle file:</strong></p>
  
  <pre><code>apply plugin: 'com.android.library'
  
  android {
      compileSdkVersion 23
      buildToolsVersion "23.0.1"
  
  
      defaultConfig {
          minSdkVersion 19
          targetSdkVersion 22
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  repositories { mavenCentral() }
  
  
  dependencies {
      compile 'com.android.support:appcompat-v7:23.+' //appcompat activity for navigation drawer
      compile 'com.android.support:design:23.+' //support for pre Android L desing views
      compile 'com.android.support:support-v13:23.+' //support for pre Android L other
      compile 'com.google.android.gms:play-services:8.1.0' //google maps
      compile 'com.facebook.android:facebook-android-sdk:4.6.0' //facebook lib
      compile 'de.hdodenhof:circleimageview:2.0.0' //circle image view
      compile 'com.squareup.picasso:picasso:2.5.2' //image downloader lib
      compile 'com.google.code.gson:gson:2.4' //gson for serialization
      compile 'com.squareup.okhttp:okhttp-android-support:2.5.0'  //networking lib bugfix lib ..? kell ez ?
      compile 'com.squareup.okio:okio:1.6.0'  //okhttp dependency
      compile 'com.squareup.okhttp:okhttp:2.5.0'   //networking lib
      compile 'com.googlecode.libphonenumber:libphonenumber:5.5' //phone number validation library
  
  
      compile fileTree(dir: 'libs', include: ['*.jar'])
  
  
  }
  </code></pre>
  
  <p><strong>DoToDoCourier app gradle file:</strong></p>
  
  <pre><code>apply plugin: 'com.android.application'
  apply plugin: 'com.google.gms.google-services'
  
  android {
      compileSdkVersion 23
      buildToolsVersion "23.0.1"
  
      defaultConfig {
          applicationId "com.illion.dotodo.application.courier"
          minSdkVersion 19
          targetSdkVersion 22
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  
  }
  
  
  repositories { mavenCentral() }
  
  dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
      compile project(':DoToDoEssentials')
  }
  </code></pre>
  
  <p><strong>DoToDoSender App gradle file:</strong></p>
  
  <pre><code>apply plugin: 'com.android.application'
  apply plugin: 'com.google.gms.google-services'
  
  android {
      compileSdkVersion 23
      buildToolsVersion "23.0.1"
  
      defaultConfig {
          applicationId "com.illion.dotodo.application.sender"
          minSdkVersion 19
          targetSdkVersion 22
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  
  repositories { mavenCentral() }
  
  dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
      compile project(':DoToDoEssentials')
  }
  </code></pre>
  
  <p>I have used this scheme for months and it was worked and now today something happened and i cannot build without error.</p>
  
  <p>So and what should i do with:</p>
  
  <p><strong>ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 2</strong></p>
  
  <p>No hint, no concrete error, just an exception.</p>
  
  <p>What i have tried:</p>
  
  <ul>
  <li>Clean project</li>
  <li>Rebuild Project</li>
  <li>Run project</li>
  <li>Invalidate caches/Restart</li>
  <li>Load an older commit</li>
  </ul>
  
  <p><strong>But the issue is still present.</strong></p>
  
  <p>I use Android Studio 1.4</p>
  
  <p>Please help if you can.</p>