How Can I solve this error
Error:Execution failed for task \':app:dexDebug\'. com.android.ide.common.process.ProcessException: org.gradle.process.i
Have you tried commenting out the following in your build.gradle:
//compile fileTree(dir: 'libs', include: ['*.jar'])
REFERENCE: https://code.google.com/p/android/issues/detail?id=161605
Welcome. You are at the first step of Android gradle hell.
Update your Android SDK components in SDK Manager to latest one including Extra > Google Repository (recommend to add almost all in Extra).
Let's wash up your current file.
AndroidManifest.xml: Remove the <uses-sdk ... />
lines. It's redundant as gradle file already defines it.
Build.gradle: Comment all compile files('libs/xxxxxxx.jar')
lines. The first line compile fileTree(dir: 'libs', include: ['*.jar'])
will include all jar files in libs
folder. And, use compile
from maven repository not jar files in order to maintain your dependencies fresh.
For example, SimpleXML has repository id as below. Place the code below of the compile fileTree(dir: 'libs', include: ['*.jar'])
line and remove 'simple-xml-2.7.1.jar' file in libs folder.
compile('org.simpleframework:simple-xml:2.7.1') {
exclude module: 'stax'
exclude module: 'stax-api'
exclude module: 'xpp3'
}
Likewise, find repository id of each jar file in your libs folder and replace it below of the compile fileTree(dir: 'libs', include: ['*.jar'])
line one by one. Make only jar files which unable to find in maven repository remain in libs folder.
Finally, remove proguardFiles
line. You need to find and fix the problem in general condition, then apply progruard afterward.
My recommendation of today is as below,
(numbers may vary when someone will see this post in the future)
android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
dexOptions {
preDexLibraries = false
javaMaxHeapSize "2g"
}
defaultConfig {
...
multiDexEnabled = false
}
lintOptions {
abortOnError false
disable 'InvalidPackage'
}
...
}
dependencies {
compile 'com.android.support:appcompat-v7:22.1.1' // Do NOT use 22.2.0 even it is newer one. It reported to cause some problems with other dependencies.
compile fileTree(dir: 'libs', include: '*.jar')
compile('com.google.android.gms:play-services-gcm:7.5.+')
{
exclude module: 'support-v4'
}
}
command gradle assembleDebug
again. (for Windows, gradlew assembleDebug
)
If failed again, try to find and fix dependencies version conflict issues one by one. You may see exclude module: ...
in my code. These resolve the conflict issue. Detailed instruction is given at the link: https://stackoverflow.com/a/30649660/361100
Amazingly this one worked for me
defaultConfig {
multiDexEnabled true
}
Source: Android Studio fails to debug with error org.gradle.process.internal.ExecException
The same error occurred to me when I imported all the Google Play Services APIs, as you do with
compile('com.google.android.gms:play-services:7.5.+')
Try removing this line and import only the Services APIs that you need: Google Play Services Setup