3

I am quite new to the studio,

I am trying to Run my application

Error is encountered -

What went wrong:

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 1

I tried with jdk 1.8 which gave the same error.

So found few answers which said to reduce jdk to 1.7

but the Error still persists

Please Suggest what to do

Gradle :

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "22.0.1"
    defaultConfig {
        applicationId "innovapptive.com.mworkorder"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:22.0.0'

}
lalita
  • 31
  • 1
  • 3
  • See these : http://stackoverflow.com/questions/28640314/android-studio-fails-to-debug-with-error-org-gradle-process-internal-execexcepti http://stackoverflow.com/questions/28917696/errorexecution-failed-for-task-appdexdebug-com-android-ide-common-process – RahulArackal Jul 13 '15 at 06:35
  • Enabling multidex gives me error : Execution failed for task ':app:packageAllDebugClassesForMultiDex'. > java.util.zip.ZipException: duplicate entry: android/support/v7/app/ActionBar$NavigationMode.class – lalita Jul 13 '15 at 07:08
  • if you're trying to use Multidex you need to provide dependency for Multidex support lib – Oleg Osipenko Jul 13 '15 at 07:09
  • Thanks,But how do i do that ....I am Quite new to this . – lalita Jul 13 '15 at 07:19
  • dependencies { compile 'com.android.support:multidex:1.0.0' compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.android.support:appcompat-v7:22.0.+' } – lalita Jul 13 '15 at 07:36
  • I am still getting the same error – lalita Jul 13 '15 at 07:36
  • Please Help..this is drving me crazy Error that i am getting -- Execution failed for task ':app:packageAllDebugClassesForMultiDex'. > java.util.zip.ZipException: duplicate entry: android/support/v7/view/ActionMode$Callback.class – lalita Jul 13 '15 at 08:46
  • It should help to solve your issue: http://stackoverflow.com/a/27284064/2737927 – jlga Aug 14 '15 at 08:05
  • Hello, can you please add working code if possible ? – Hardik Joshi Nov 08 '15 at 20:09

3 Answers3

2

This is what worked for me taken from this answer:

defaultConfig {
   multiDexEnabled true
}
Community
  • 1
  • 1
Horatio
  • 1,695
  • 1
  • 18
  • 27
2

What worked for me was: Build-> Rebuild Project

1

I fllow the first answer and then another problem caused: **Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'.

java.util.zip.ZipException: duplicate entry: com/umeng/analytics/AnalyticsConfig.class** Then it happened: Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'. java.util.zip.ZipException: duplicate entry: com/umeng/analytics/AnalyticsConfig.class So I tried to remove this:

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile project(':libraries:SlidingMenu')
    compile files('libs/volley_src.jar')
    compile files('libs/Volley_bin.jar')
//    compile 'com.umeng.analytics:analytics:latest.integration'
//    compile files('libs/umeng-analytics-v5.6.1.jar')
    compile files('libs/xUtils-2.6.14.jar')
}

It works and I don't know why,I may try the latest Umeng SDK later. It may work for you if you are using count and analysis SDK.

QIAN KEQIAO
  • 541
  • 1
  • 4
  • 7
  • What;s more,I tried the latest SDK and it's marked as a suitable version for Android 6.0,It may be the result for the problem,I guess – QIAN KEQIAO Mar 07 '16 at 03:42