2015-07-03 23 views
5

Konsola Gradle Build wyświetla ten komunikat.dodaj błąd dexdebug podczas budowania projektu Android

Error:Execution failed for task ':app:dexDebug'. 
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2 

Powiedziano mi, że ten problem wynika z nieprawidłowego ustawienia pliku build.gradle. Mój plik gradów wygląda tak.

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 22 
buildToolsVersion "23.0.0 rc2" 

defaultConfig { 
    applicationId "com.marshall.gruppo" 
    minSdkVersion 15 
    targetSdkVersion 22 
    versionCode 1 
    versionName "1.0" 
} 
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.2.0' 
compile project(':volley') 
compile project(':android-support-v4') 
} 

Co powinienem tutaj poprawić?

+1

Check out: http://stackoverflow.com/questions/28640314/android -studio-fail-to-debug-with-error-org-gradle-process-internal-execexcepti –

+0

@HareshChhelana Dzięki za informację zwrotną. Poszedłem za sugestią, a teraz pokazuje kolejny błąd! Błąd: Wykonanie nie powiodło się dla zadania ": app: pakietAllDebugClassesForMultiDex". > java.util.zip.ZipException: duplikat wpisu: android/support/v4/internal/view/SupportMenu.class –

+0

Zaktualizuj swoje pytanie, aby odzwierciedlić ten nowy problem, w ten sposób z większym prawdopodobieństwem znajdziesz odpowiedzi –

Odpowiedz

3

umieścić to w swoim build.gradle:

android { 
... 
    defaultConfig { 
    ... 
    multiDexEnabled true 
    ... 
    } 
... 
} 
... 
dependencies { 
    ... 
    compile 'com.android.support:multidex:1.0.1' 
    ... 
} 

i umieścić to w swoim AndroidManifest.xml:

<application 
... 
android:name="android.support.multidex.MultiDexApplication" 
...> 
Powiązane problemy