This question already has an answer here:
today i faced with this build error 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.
Error:
Error:Execution failed for task ':DoToDoCourierApp:transformClassesWithDexForDebug'.
> 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
Full log:
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'.
> 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
I got 3 modules. 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.
- DoToDoEssentials: library module, containing all the compiled libs
- DoToDoCourier: App module
- DoToDoSender: App module
Here are the gradle files:
Top level build.gradle for project:
// 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()
}
}
DoToDoEssentials module gradle file:
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'])
}
DoToDoCourier app gradle file:
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')
}
DoToDoSender App gradle file:
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')
}
I have used this scheme for months and it was worked and now today something happened and i cannot build without error.
So and what should i do with:
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
No hint, no concrete error, just an exception.
What i have tried:
- Clean project
- Rebuild Project
- Run project
- Invalidate caches/Restart
- Load an older commit
But the issue is still present.
I use Android Studio 1.4
Please help if you can.
370 views and still no response after a month.
I was able to reproduce this strange thing that happens after you either update build tools or try to make your app multidex. You will usually get some TransformException (gradle inner exception) which does not tell you much, but and after you compile with --info --debug you will probably notice that it's an error with GC overhead (it's out of memory).
For the fix of the memory limit you can check related thread here on SO: Android Studio Google JAR file causing GC overhead limit exceeded error but if you need quick fix, add this javaMaxHeapSize to your dexOptions as follows:
PS: for some explanation of the options see this thread: how can I use Android dexOptions?