I am new in android programming. when I am running my app it shows this kind of error
Error:Execution failed for task ':app:dexDebug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_67\bin\java.exe'' finished with non-zero exit value 2
it is my gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "uz.ums"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
useLibrary 'org.apache.http.legacy'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.github.traex.rippleeffect:library:1.3'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.android.support:recyclerview-v7:+'
compile files('libs/picasso-2.5.2.jar')
compile 'com.squareup.okhttp3:okhttp:3.0.1'
}
I cleaned project and rebuild but this didn't help to me.What can you suggest to me! Thanks beforehand
You can try this one
defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}
Related
I couldn't solve the problem in any way. I am waiting for your help in this regard.
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "23.0.1"
defaultConfig {
multiDexEnabled = true
applicationId "com.apaweb.track"
minSdkVersion 16
targetSdkVersion 22
versionCode 14
versionName "2.0.3"
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.+'
compile 'com.android.support:design:22.+'
compile 'com.android.support:cardview-v7:22.+'
compile 'com.android.support:recyclerview-v7:22.+'
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.tuenti.smsradar:library:1.0.4'
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.android.support:multidex:1.0.0'
compile 'com.koushikdutta.ion:ion:2.+'
compile 'com.koushikdutta.async:androidasync:2.+'
}
I think that was the problem after updating the java.
JDK 1.7, JDK 1.8 and JDK 9 are installed in the system. I am using JDK 1.7 now.
Error:Execution failed for task ':app:transformClassesWithDexForDebug'. com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_80\bin\java.exe'' finished with non-zero exit value 1
I solved the problem. By upgrading Android studio and gradle versions.
I have changed my package name of my app. Now this error is showing when i want to build apk.
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: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_73\bin\java.exe'' finished with non-zero exit value 2
Here is my module build.gradle
file -
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.previewtechs.blacklistpro"
minSdkVersion 11
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v4:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.j256.ormlite:ormlite-android:4.48'
compile files ('libs/libphonenumber-7.4.4.jar')
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.google.android.gms:play-services-analytics:9.0.0'
}
apply plugin: 'com.google.gms.google-services'
What is the problem? and what to do to solve it? Thanks.
After trying my hand at a bit of programming, I wanted to run my app on my phone only to encounter this error.
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_80\bin\java.exe'' finished with non-zero exit value 2
I have absolutely no idea how to tackle it. I have googled the error, which led me to this answer. I tried the method and I still encounter the error above.
This is what my Build.gradle file looks like:
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.peikle.peikle"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
dexOptions{
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.parse:parse-android:1.10.3'
}
I don't know what else to include to make the picture clearer but I'd be happy to do so on request.
Addition:
I have tried cleaning the project which unfortunately didn't work out like I'd hoped. Then I followed the links provided by g2o, and Ret and tried following the instructions there. This is what my build.gradle file looks like now:
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.peikle.peikle"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
dexOptions{
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.parse.bolts:bolts-android:1.+'
compile 'com.parse:parse-android:1.+'
Now, I'm getting this error:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/parse/AbstractQueryController$1.class
It's a bit different from what I experienced before and I have no idea how to clean out this one.
Error that iam getting :
Error:Execution failed for task ':app:preDexDebug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 1
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.icreate.icreate"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
compileOptions{
sourceCompatibility JavaVersion.VERSION_1_6
targetCompatibility JavaVersion.VERSION_1_6}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven {
url "https://jitpack.io"
}
}
dependencies {
compile 'com.firebase:firebase-client-android:2.3.1+'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.android.support:cardview-v7:+'
compile 'com.github.timlian:android-javamail:3258af8228'
compile files('libs/activation.jar')
compile files('libs/additionnal.jar')
compile files('libs/mail.jar')
}
Just add multiDexEnabled
defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}
For more info please have a look at:
How to enable multidexing with the new Android Multidex support library
https://developer.android.com/studio/build/multidex.html
I have a problem with android studio, when I add guava-18.jar lib and run my Main I get an Error:
Error:Gradle: Execution failed for task ':app:dexDebug'.>
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 try to add this in build.gradle
defaultConfig {
multiDexEnabled true
}
but do not resolve.
Please help me!!!
my build gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "it.unical.mat.myapp"
minSdkVersion 15
targetSdkVersion 23
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:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.google.android.gms:play-services:8.1.0'
compile files('libs/activation.jar')
compile files('libs/gdata-analytics-2.1.jar')
compile files('libs/gdata-core-1.0.jar')
compile files('libs/gdata-spreadsheet-3.0.jar')
compile files('libs/jsr305.jar')
compile files('libs/mail.jar')
compile files('libs/guava-18.0.jar')
}
In Gradle File need add "com.android.support:multidex:1.0.0" This Packeage
in Activity need to update
MultiDex.install(this);
Refer this site
https://developer.android.com/tools/building/multidex.html