Execution failed for task ':app:transformClassesWithDexForDebug' error - java

I'm having this error above whenever i try to build an APK:
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.android.dx.command.Main with arguments {--dex --num-threads=4 --multi-dex --main-dex-list C:\Users\admin\Desktop\FlagQuiz\app\build\intermediates\multi-dex\debug\maindexlist.txt --output C:\Users\admin\Desktop\FlagQuiz\app\build\intermediates\transforms\dex\debug\folders\1000\1f\main C:\Users\admin\Desktop\FlagQuiz\app\build\intermediates\transforms\jarMerging\debug\jars\1\1f\combined.jar}
This is my gradle build file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.quiz"
multiDexEnabled true
minSdkVersion 15
targetSdkVersion 25
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_5
targetCompatibility JavaVersion.VERSION_1_5
}
}
dexOptions {
javaMaxHeapSize "2g"
preDexLibraries = false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
'proguard-rules.pro'
lintOptions {
disable 'MissingTranslation'
// checkRleaeseBuilds false
abortOnError false
}
}
}
}
dependencies {
compile project(':BaseGameUtils')
compile 'com.google.android.gms:play-services:11.0.4'
compile 'com.google.firebase:firebase-core:11.0.2'
compile 'com.google.firebase:firebase-crash:11.0.2'
compile 'com.google.android.gms:play-services-auth:11.0.4'
compile 'com.android.support:multidex:1.0.1'
}
//apply plugin: 'com.google.gms.google-services' <-- I commented it according to some solutions but it's didn't solve the problem
How i can solve this error, i've followed some solutions here and in some forums but nothing worked with me..
Thank you for any help!!
Gradle console:
Executing tasks: [:BaseGameUtils:assembleDebug, :app:assembleDebug]
Configuration on demand is an incubating feature.
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to C:\Users\admin\AppData\Local\Android\sdk\ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.
The setTestClassesDir(File) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the setTestClassesDirs(FileCollection) method instead.
The getTestClassesDir() method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the getTestClassesDirs() method instead.
The ConfigurableReport.setDestination(Object) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the method ConfigurableReport.setDestination(File) instead.
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to C:\Users\admin\AppData\Local\Android\sdk\ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.
:BaseGameUtils:preBuild UP-TO-DATE
:BaseGameUtils:preDebugBuild UP-TO-DATE
:BaseGameUtils:checkDebugManifest
:BaseGameUtils:preDebugAndroidTestBuild UP-TO-DATE
:BaseGameUtils:preDebugUnitTestBuild UP-TO-DATE
:BaseGameUtils:preReleaseBuild UP-TO-DATE
:BaseGameUtils:preReleaseUnitTestBuild UP-TO-DATE
:BaseGameUtils:prepareComAndroidSupportAnimatedVectorDrawable2540Library
:BaseGameUtils:prepareComAndroidSupportAppcompatV72540Library
:BaseGameUtils:prepareComAndroidSupportSupportCompat2540Library
:BaseGameUtils:prepareComAndroidSupportSupportCoreUi2540Library
:BaseGameUtils:prepareComAndroidSupportSupportCoreUtils2540Library
:BaseGameUtils:prepareComAndroidSupportSupportFragment2540Library
:BaseGameUtils:prepareComAndroidSupportSupportMediaCompat2540Library
:BaseGameUtils:prepareComAndroidSupportSupportV42540Library
:BaseGameUtils:prepareComAndroidSupportSupportVectorDrawable2540Library
:BaseGameUtils:prepareComGoogleAndroidGmsPlayServicesAuth1102Library
:BaseGameUtils:prepareComGoogleAndroidGmsPlayServicesAuthBase1102Library
:BaseGameUtils:prepareComGoogleAndroidGmsPlayServicesBase1102Library
:BaseGameUtils:prepareComGoogleAndroidGmsPlayServicesBasement1102Library
:BaseGameUtils:prepareComGoogleAndroidGmsPlayServicesDrive1026Library
:BaseGameUtils:prepareComGoogleAndroidGmsPlayServicesGames1026Library
:BaseGameUtils:prepareComGoogleAndroidGmsPlayServicesPlus1026Library
:BaseGameUtils:prepareComGoogleAndroidGmsPlayServicesTasks1102Library
:BaseGameUtils:prepareComGoogleFirebaseFirebaseAnalytics1102Library
:BaseGameUtils:prepareComGoogleFirebaseFirebaseAnalyticsImpl1102Library
:BaseGameUtils:prepareComGoogleFirebaseFirebaseCommon1102Library
:BaseGameUtils:prepareComGoogleFirebaseFirebaseCore1102Library
:BaseGameUtils:prepareComGoogleFirebaseFirebaseIid1102Library
:BaseGameUtils:prepareDebugDependencies
:BaseGameUtils:compileDebugAidl UP-TO-DATE
:BaseGameUtils:compileDebugNdk NO-SOURCE
:BaseGameUtils:compileLint UP-TO-DATE
:BaseGameUtils:copyDebugLint NO-SOURCE
:BaseGameUtils:compileDebugRenderscript UP-TO-DATE
:BaseGameUtils:generateDebugBuildConfig UP-TO-DATE
:BaseGameUtils:generateDebugResValues UP-TO-DATE
:BaseGameUtils:generateDebugResources UP-TO-DATE
:BaseGameUtils:mergeDebugResources UP-TO-DATE
:BaseGameUtils:processDebugManifest UP-TO-DATE
:BaseGameUtils:processDebugResources UP-TO-DATE
:BaseGameUtils:generateDebugSources UP-TO-DATE
:BaseGameUtils:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:BaseGameUtils:javaPreCompileDebug
:BaseGameUtils:compileDebugJavaWithJavac UP-TO-DATE
:BaseGameUtils:extractDebugAnnotations UP-TO-DATE
:BaseGameUtils:mergeDebugShaders UP-TO-DATE
:BaseGameUtils:compileDebugShaders UP-TO-DATE
:BaseGameUtils:generateDebugAssets UP-TO-DATE
:BaseGameUtils:mergeDebugAssets UP-TO-DATE
:BaseGameUtils:mergeDebugProguardFiles UP-TO-DATE
:BaseGameUtils:packageDebugRenderscript NO-SOURCE
:BaseGameUtils:packageDebugResources UP-TO-DATE
:BaseGameUtils:processDebugJavaRes NO-SOURCE
:BaseGameUtils:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:BaseGameUtils:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
:BaseGameUtils:mergeDebugJniLibFolders UP-TO-DATE
:BaseGameUtils:transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE
:BaseGameUtils:transformNativeLibsWithSyncJniLibsForDebug UP-TO-DATE
:BaseGameUtils:bundleDebug UP-TO-DATE
:BaseGameUtils:compileDebugSources UP-TO-DATE
:BaseGameUtils:assembleDebug UP-TO-DATE
:BaseGameUtils:checkReleaseManifest
:BaseGameUtils:prepareReleaseDependencies
:BaseGameUtils:compileReleaseAidl UP-TO-DATE
:BaseGameUtils:compileReleaseNdk NO-SOURCE
:BaseGameUtils:copyReleaseLint NO-SOURCE
:BaseGameUtils:compileReleaseRenderscript UP-TO-DATE
:BaseGameUtils:generateReleaseBuildConfig UP-TO-DATE
:BaseGameUtils:generateReleaseResValues UP-TO-DATE
:BaseGameUtils:generateReleaseResources UP-TO-DATE
:BaseGameUtils:mergeReleaseResources UP-TO-DATE
:BaseGameUtils:processReleaseManifest UP-TO-DATE
:BaseGameUtils:processReleaseResources UP-TO-DATE
:BaseGameUtils:generateReleaseSources UP-TO-DATE
:BaseGameUtils:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
:BaseGameUtils:javaPreCompileRelease
:BaseGameUtils:compileReleaseJavaWithJavac UP-TO-DATE
:BaseGameUtils:extractReleaseAnnotations UP-TO-DATE
:BaseGameUtils:mergeReleaseShaders UP-TO-DATE
:BaseGameUtils:compileReleaseShaders UP-TO-DATE
:BaseGameUtils:generateReleaseAssets UP-TO-DATE
:BaseGameUtils:mergeReleaseAssets UP-TO-DATE
:BaseGameUtils:mergeReleaseProguardFiles UP-TO-DATE
:BaseGameUtils:packageReleaseRenderscript NO-SOURCE
:BaseGameUtils:packageReleaseResources UP-TO-DATE
:BaseGameUtils:processReleaseJavaRes NO-SOURCE
:BaseGameUtils:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
:BaseGameUtils:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
:BaseGameUtils:mergeReleaseJniLibFolders UP-TO-DATE
:BaseGameUtils:transformNativeLibsWithMergeJniLibsForRelease UP-TO-DATE
:BaseGameUtils:transformNativeLibsWithSyncJniLibsForRelease UP-TO-DATE
:BaseGameUtils:bundleRelease UP-TO-DATE
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2540Library
:app:prepareComAndroidSupportAppcompatV72540Library
:app:prepareComAndroidSupportMediarouterV72520Library
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library
:app:prepareComAndroidSupportPaletteV72520Library
:app:prepareComAndroidSupportSupportCompat2540Library
:app:prepareComAndroidSupportSupportCoreUi2540Library
:app:prepareComAndroidSupportSupportCoreUtils2540Library
:app:prepareComAndroidSupportSupportFragment2540Library
:app:prepareComAndroidSupportSupportMediaCompat2540Library
:app:prepareComAndroidSupportSupportV42540Library
:app:prepareComAndroidSupportSupportVectorDrawable2540Library
:app:prepareComGoogleAndroidGmsPlayServices1104Library
:app:prepareComGoogleAndroidGmsPlayServicesAds1104Library
:app:prepareComGoogleAndroidGmsPlayServicesAdsLite1104Library
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics1104Library
:app:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl1104Library
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite1104Library
:app:prepareComGoogleAndroidGmsPlayServicesAuth1104Library
:app:prepareComGoogleAndroidGmsPlayServicesAuthApiPhone1104Library
:app:prepareComGoogleAndroidGmsPlayServicesAuthBase1104Library
:app:prepareComGoogleAndroidGmsPlayServicesAwareness1104Library
:app:prepareComGoogleAndroidGmsPlayServicesBase1104Library
:app:prepareComGoogleAndroidGmsPlayServicesBasement1104Library
:app:prepareComGoogleAndroidGmsPlayServicesCast1104Library
:app:prepareComGoogleAndroidGmsPlayServicesCastFramework1104Library
:app:prepareComGoogleAndroidGmsPlayServicesClearcut1104Library
:app:prepareComGoogleAndroidGmsPlayServicesDrive1104Library
:app:prepareComGoogleAndroidGmsPlayServicesFitness1104Library
:app:prepareComGoogleAndroidGmsPlayServicesGames1104Library
:app:prepareComGoogleAndroidGmsPlayServicesGass1104Library
:app:prepareComGoogleAndroidGmsPlayServicesGcm1104Library
:app:prepareComGoogleAndroidGmsPlayServicesIdentity1104Library
:app:prepareComGoogleAndroidGmsPlayServicesIid1104Library
:app:prepareComGoogleAndroidGmsPlayServicesInstantapps1104Library
:app:prepareComGoogleAndroidGmsPlayServicesLocation1104Library
:app:prepareComGoogleAndroidGmsPlayServicesMaps1104Library
:app:prepareComGoogleAndroidGmsPlayServicesNearby1104Library
:app:prepareComGoogleAndroidGmsPlayServicesPanorama1104Library
:app:prepareComGoogleAndroidGmsPlayServicesPlaces1104Library
:app:prepareComGoogleAndroidGmsPlayServicesPlus1104Library
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet1104Library
:app:prepareComGoogleAndroidGmsPlayServicesTagmanager1104Library
:app:prepareComGoogleAndroidGmsPlayServicesTagmanagerApi1104Library
:app:prepareComGoogleAndroidGmsPlayServicesTagmanagerV4Impl1104Library
:app:prepareComGoogleAndroidGmsPlayServicesTasks1104Library
:app:prepareComGoogleAndroidGmsPlayServicesVision1104Library
:app:prepareComGoogleAndroidGmsPlayServicesVisionCommon1104Library
:app:prepareComGoogleAndroidGmsPlayServicesWallet1104Library
:app:prepareComGoogleAndroidGmsPlayServicesWearable1104Library
:app:prepareComGoogleFirebaseFirebaseAnalytics1104Library
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl1104Library
:app:prepareComGoogleFirebaseFirebaseAppindexing1104Library
:app:prepareComGoogleFirebaseFirebaseAuth1104Library
:app:prepareComGoogleFirebaseFirebaseCommon1104Library
:app:prepareComGoogleFirebaseFirebaseConfig1104Library
:app:prepareComGoogleFirebaseFirebaseCore1102Library
:app:prepareComGoogleFirebaseFirebaseCrash1104Library
:app:prepareComGoogleFirebaseFirebaseDatabase1104Library
:app:prepareComGoogleFirebaseFirebaseDatabaseConnection1104Library
:app:prepareComGoogleFirebaseFirebaseDynamicLinks1104Library
:app:prepareComGoogleFirebaseFirebaseIid1104Library
:app:prepareComGoogleFirebaseFirebaseMessaging1104Library
:app:prepareComGoogleFirebaseFirebaseStorage1104Library
:app:prepareComGoogleFirebaseFirebaseStorageCommon1104Library
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:javaPreCompileDebug
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk NO-SOURCE
:app:compileDebugSources UP-TO-DATE
:app:mergeDebugShaders
:app:compileDebugShaders
:app:generateDebugAssets
:app:mergeDebugAssets
:app:transformClassesWithJarMergingForDebug
:app:transformClassesWithMultidexlistForDebug
:app:transformClassesWithDexForDebug
Running dex as a separate process.
To run dex in process, the Gradle daemon needs a larger heap.
It currently has 1024 MB.
For faster builds, increase the maximum heap size for the Gradle daemon to at least 2560 MB (based on the dexOptions.javaMaxHeapSize = 2g).
To do this set org.gradle.jvmargs=-Xmx2560M in the project gradle.properties.
For more information see https://docs.gradle.org/current/userguide/build_environment.html
:app:transformClassesWithDexForDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.android.dx.command.Main with arguments {--dex --num-threads=4 --multi-dex --main-dex-list C:\Users\admin\Desktop\FlagQuiz\app\build\intermediates\multi-dex\debug\maindexlist.txt --output C:\Users\admin\Desktop\FlagQuiz\app\build\intermediates\transforms\dex\debug\folders\1000\1f\main C:\Users\admin\Desktop\FlagQuiz\app\build\intermediates\transforms\jarMerging\debug\jars\1\1f\combined.jar}
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 3s
154 actionable tasks: 102 executed, 52 up-to-date

Related

Building Google Maps example project with Android Studio 2.2.2

I have just downloaded Android Studio 2.2.2 and I try to build example projects. Blank activity project builds, deploys and runs successfully on my phone.
Then I try to build Google Maps project. I obtained an API key, copied it into google_maps_api.xml and didn't change anything else. Then, if I press Build -> Build APK, it fails with the following messages in Gradle Console:
Executing tasks: [:app:assembleDebug]
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:prepareComAndroidSupportAnimatedVectorDrawable2500Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72500Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72400Library UP-TO-DATE
:app:prepareComAndroidSupportPaletteV72400Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCompat2500Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUi2500Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUtils2500Library UP-TO-DATE
:app:prepareComAndroidSupportSupportFragment2500Library UP-TO-DATE
:app:prepareComAndroidSupportSupportMediaCompat2500Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42500Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2500Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAdsLite980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuth980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuthBase980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAwareness980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCastFramework980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesClearcut980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGames980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGass980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIid980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesInstantapps980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlaces980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTagmanager980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTagmanagerApi980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTasks980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesVision980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalytics980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuth980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuthCommon980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuthModule980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCommon980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseConfig980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCrash980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseDatabase980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseDatabaseConnection980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseIid980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseMessaging980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseStorage980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseStorageCommon980Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:transformClassesWithDexForDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
* 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: 53.036 secs
First I noticed "Incremental java compilation is an incubating feature" message. Maybe incremental compilation is the reason of the failure? If so, how can I disable it? I didn't find anything about it in build.gradle and other gradle-related files.
And if incremental build is not the reason, then what is it and how to fix it? This:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
looks like a gradle internal error. Am I right? Here is my build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
You must enable multidex for your project as total number of methods in your build exceeds 65536. See Configure Apps with Over 64K Methods

Error:Execution failed for task ':app:mergeDebugResources'

I don't even know where to start or even how to ask.
Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42311Library 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 FAILED
Error:Execution failed for task ':app:mergeDebugResources'.
java.lang.ArrayIndexOutOfBoundsException (no error message)
Information:BUILD FAILED
Information:Total time: 1.241 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
I've never updated Android Studio, and I saw some similar problems and non of the solutions they gave worked for me.
I tried to change the class path from
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
to
dependencies {
classpath 'com.android.tools.build:gradle:0.4.3'
}
I don't know where to go from there

Android Studio Gradle doesn't build my app when using Comparator class?

This compiles and builds fine:
Collections.sort(array, null);
This one doesn't:
Collections.sort(array, new Comparator<ChatText>() {
#Override
public int compare(ChatText o1, ChatText o2) {
return (int) (o1.timestamp - o2.timestamp);
}
});
That's what I get:
Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72310Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2310Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72220Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72310Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42310Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidAnswers132Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidBeta113Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidCrashlytics252Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidCrashlyticsCore235Library UP-TO-DATE
:app:prepareComFacebookAndroidFacebookAndroidSdk470Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppstate810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGames810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesVision810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable810Library UP-TO-DATE
:app:prepareIoFabricSdkAndroidFabric136Library 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 UP-TO-DATE
:app:fabricGenerateResourcesDebug
:app:processDebugResources
:app:generateDebugSources
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:preDexDebug UP-TO-DATE
:app:dexDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:502)
at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:277)
at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:491)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:168)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
Information:BUILD FAILED
Information:Total time: 10.116 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
Tried cleaning the project few times, didn't help. A solution without the usage of Comparator class would help too.
Nothing to do with Comparator class. You have reached your dexing limit. This means you have reached the limit for references that can be invoked by the code within a single Dalvik Executable (Googles explanation). The solution is very easy. Take a look at this answer to see how to enable multidexing.

ProcessException: org.gradle.process.internal.ExecException finished with non-zero exit value 2 [duplicate]

This question already has answers here:
Android Studio: Unexpected top level exception (finished with non-zero exit value 2..)
(3 answers)
Closed 7 years ago.
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:
android {
...
dexOptions {
incremental = true;
preDexLibraries = false
javaMaxHeapSize "4g" // 2g should be also OK
}
...
}
PS: for some explanation of the options see this thread: how can I use Android dexOptions?

Gradle does not recognize changes in jar manifest

I am new to gradle and try out some basic examples from the command line.
The example tells me to put this into my build.gradle file to make the class my main jar class.
jar.manifest.attributes 'Main-Class': 'de.gradlebuch.HelloWorld'
After that, the build output should look like this:
PS C:\Users\user\Desktop\gradle test\HelloWorld> gradle build
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar
:assemble
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE
:check UP-TO-DATE
:build UP-TO-DATE
Unfortunately, it isn't. I get:
PS C:\Users\user\Desktop\gradle test\HelloWorld> gradle build
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar UP-TO-DATE
:assemble UP-TO-DATE
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE
:check UP-TO-DATE
:build UP-TO-DATE
The jar and assembler task are UP_TO_DATE and the attribute is not in the Manifest.MF file.
When I do
gradle clean
gradle build
everything is fine. But I tought Gradle would be capable of detecting these kind of changes without rebuilding everyting.
What can I do to get Gradle detect changes in my build.gradle file?

Categories

Resources