2016-01-21 6 views
6

Próbowałem wielu rozwiązań, nawet włączone multiDexEnabled prawda, ale nadal otrzymuję ten błąd UNEXPECTED TOP-LEVEL ERROR. To jest mój buildNieoczekiwany błąd najwyższego poziomu

android { 
compileSdkVersion 22 
buildToolsVersion '22.0.1' 

defaultConfig { 
    applicationId "com.xxx" 
    minSdkVersion 11 
    targetSdkVersion 22 
    versionCode 1 
    versionName "1.0" 
    multiDexEnabled true 

} 
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:22.2.1' 
compile 'com.loopj.android:android-async-http:1.4.9' 
compile 'com.google.android.gms:play-services:8.1.0' 
compile 'com.googlecode.libphonenumber:libphonenumber:6.2' 
compile 'com.paypal.sdk:paypal-android-sdk:2.12.4' 
compile 'com.android.support:design:22.2.1' 
compile 'com.google.zxing:core:3.2.0' 
compile 'com.android.support:multidex:1.0.1' 
} 

otrzymuję ten błąd

UNEXPECTED TOP-LEVEL ERROR: 
java.lang.OutOfMemoryError: GC overhead limit exceeded 
    at com.android.dx.rop.code.PlainInsn.withNewRegisters(PlainInsn.java:152) 
    at com.android.dx.ssa.NormalSsaInsn.toRopInsn(NormalSsaInsn.java:126) 
    at com.android.dx.ssa.back.SsaToRop.convertInsns(SsaToRop.java:341) 
    at com.android.dx.ssa.back.SsaToRop.convertBasicBlock(SsaToRop.java:322) 
    at com.android.dx.ssa.back.SsaToRop.convertBasicBlocks(SsaToRop.java:259) 
    at com.android.dx.ssa.back.SsaToRop.convert(SsaToRop.java:123) 
    at com.android.dx.ssa.back.SsaToRop.convertToRopMethod(SsaToRop.java:69) 
    at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:101) 
    at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:72) 
    at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:297) 
    at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:137) 
    at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:93) 
    at com.android.dx.command.dexer.Main.processClass(Main.java:729) 
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673) 
    at com.android.dx.command.dexer.Main.access$300(Main.java:83) 
    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602) 
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284) 
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166) 
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144) 
    at com.android.dx.command.dexer.Main.processOne(Main.java:632) 
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:505) 
    at com.android.dx.command.dexer.Main.runMultiDex(Main.java:334) 
    at com.android.dx.command.dexer.Main.run(Main.java:244) 
    at com.android.dx.command.dexer.Main.main(Main.java:215) 
    at com.android.dx.command.Main.main(Main.java:106) 


FAILED 

FAILURE: Build failed with an exception. 

* What went wrong: 
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 '/usr/lib/jvm/java-8-openjdk-amd64/bin/java'' finished with non-zero exit value 3 

* Try: 
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 

Co robię źle tutaj, to jest konflikt biblioteki albo ja czegoś brakuje tutaj

Odpowiedz

27

dodać do Twój build.gradle (po twoim buildTypes)

dexOptions { 
    javaMaxHeapSize "4g" 
} 
+0

po przeanalizowaniu wielu rozwiązań, tak właśnie jest zaginął. : D Z góry dziękuję, – Tuna

+0

co on robi i co oznacza? ktoś? –

+0

@JongzPuangput jest opcją określenia maksymalnej puli alokacji pamięci dla operacji dekompresji JVM (4g oznacza 4 gigabajty) – Bronx