2016-08-22 60 views
0

我在Android Studio中得到這個錯誤的Android Studio錯誤:執行失敗的任務:應用程序:transformClassesWithDexForDebug

Error: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_66\bin\java.exe'' finished with non-zero exit value 1 

的build.gradle文件

buildscript { 
    repositories { 
     maven { url 'https://maven.fabric.io/public' } 
    } 

    dependencies { 
     classpath 'io.fabric.tools:gradle:1.+' 
    } 
} 
apply plugin: 'com.android.application' 
apply plugin: 'io.fabric' 


repositories { 
    maven { 
     url "https://mint.splunk.com/gradle/" 
    } 
} 

repositories { 
    maven { url 'https://maven.fabric.io/public' } 

} 


android { 
    // useLibrary 'org.apache.http.legacy' 
    useLibrary 'org.apache.http.legacy' 
    //compileSdkVersion 23 
    // buildToolsVersion '23.0.2' 
    compileSdkVersion 23 
    buildToolsVersion '23.0.2' 


    defaultConfig { 
     applicationId "com.tankkk" 
     minSdkVersion 16 
     targetSdkVersion 21 
     versionCode 38 
     versionName "4.8" 
     // Enabling multidex support. 
     multiDexEnabled true 
    } 


    packagingOptions { 
     exclude 'META-INF/DEPENDENCIES' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/LICENSE' 
    } 


    dexOptions { 
     incremental true 
     javaMaxHeapSize "2048M" 
    } 

    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 

    sourceSets { 
     main { 
      jniLibs.srcDir 'src/main/jniLibs' 
     } 
    } 


} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    // compile project(':vitamio') 
    //compile project(':recorder') 
    compile project(':videorecording') 
    compile project(':cropper') 
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true; 
    } 
    compile('com.twitter.sdk.android:twitter:[email protected]') { 
     transitive = true; 
    } 
    // compile 'com.danikula:videocache:1.0.1' 
    // compile 'com.danikula:videocache:2.3.4' 
    // compile 'com.github.hiteshsondhi88.libffmpeg:FFmpegAndroid:0.2.5' 
    //compile 'net.gotev:uploadservice:2.0' 
    compile project(':recorder') 
    //compile 'com.android.support:support-v4:24.0.0-aplha1' 
    compile 'com.pnikosis:materialish-progress:1.5' 
    compile 'com.timehop.stickyheadersrecyclerview:library:0.4.3' 
    compile 'com.oguzdev:CircularFloatingActionMenu:1.0.2' 
    compile 'com.kyleduo.switchbutton:library:1.2.8' 
    compile 'com.google.android.gms:play-services-base:8.4.0' 
    compile 'com.google.android.gms:play-services-gcm:8.4.0' 
    compile 'com.google.android.gms:play-services-location:8.4.0' 
    compile 'com.baoyz.swipemenulistview:library:1.2.1' 
    compile 'com.splunk.mint:mint:4.4.0' 
    compile 'com.google.android.exoplayer:exoplayer:r1.5.4' 
    compile 'it.sephiroth.android.library.targettooltip:target-tooltip-library:+' 
    //compile 'net.gotev:uploadservice:2.1' 
    compile project(':uploadservice') 
} 
+0

什麼是您的gradle版本? – Raghavendra

+0

@Amit Desale查看我的發燒友 –

+0

@Raghavendra gradle版本是2.10 –

回答

0
dexOptions { 
    incremental true 
    javaMaxHeapSize "4g" 
} 

把上面的行放在gradle中的android括號中,並把下面幾行開始onCreate你的發射活動。

MultiDex.install(this); 

之後清除生成項目 - >清理項目。

這將解決您的問題。

+0

對我無效 –

+0

您爲什麼認爲這是一個multidex問題? –

+0

我得到了以上錯誤 –

相關問題