Error:Execution failed for task \':app:dexDebug\'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process
After trying every single one of the solutions, the only thing that helped me was removing the "multiDexEnabled true".
Found 2 resolutions.
I. First one is simple. Open AS error log file (generated in project directory) and if it contains information that there is not enough memory for Java to do it's job - simply close unnecessary applications to free memory and run again.
II. Another one is due to corrupted project files (for some reason): Do project clean up and then import again in Android Studio (AS). That's how to do it in details.
Note: that you'll end up without all project specific AS settings.
That's simply the thing, which I do from time to time when upgrading to latest AS. That is one of the reasons I never commit those AS-related files to VCS (and teammates allways do import in AS after fresh check out from VCS)
It is not clear when you got this problem, but I was having a similar problem trying to do a unit test in Android Studio.
My problem was with one of my dependencies (androidannotation). When I removed it, my tests worked well.
I fixed this issue by upgrading the Gradle Build version in Android Studio. You can do this using:
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
}
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
//multiDexEnabled false
applicationId "com.example.aishwarya.myapplication"
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:21.0.3'
//compile files('libs/android-support-v4.jar')
compile files('libs/gson-2.2.4.jar')
compile files('libs/okhttp-1.6.0.jar')
compile files('libs/okhttp-urlconnection-1.6.0.jar')
compile files('libs/okio-1.0.0.jar')
compile files('libs/otto-1.3.4.jar')
compile files('libs/picasso-2.3.1.jar')
compile files('libs/retrofit-1.5.1.jar')
compile files('libs/scribe-1.3.5.jar')
compile files('libs/twitter-text-1.6.1.jar')
compile 'com.android.support:support-v4:21.0.3'
}
The problem is with this line
('com.android.support:support-v4:22.0.0')
from dependencies as :
dependencies {
compile files('libs/cordova-2.7.0.jar')
compile files('libs/google-play-services.jar')
compile files('libs/java_websocket.jar')
compile 'com.android.support:support-v4:22.0.0'
}
in project.gradle file.. Remove it..