简体   繁体   中英

Android studio Error:Execution failed for task :app:transformClassesWithDexForDebug

I got this error in android studio

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 file is

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:2.5.1@aar') {
        transitive = true;
    }
    compile('com.twitter.sdk.android:twitter:1.7.2@aar') {
        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')
}
dexOptions {
    incremental true
    javaMaxHeapSize "4g"
}

Put above line in android brackets in gradle and put the following lines start of onCreate of your LAUNCHER Activity.

    MultiDex.install(this);

After that clear your project from Build -> Clean Project.

This will solve your problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM