Execution failed for task ': app: transformClassesWithDexForDebug'

I try to execute the code, but I get an error in the gradle build messages that

Execution failed for  task ':app:transformClassesWithDexForDebug'.
Error: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 'C:\Program Files\Java\jdk1.7.0_45\bin\java.exe'' finished with non-zero exit value 2

build.gradle (application module) of my project.

  apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.0"

    defaultConfig {
        applicationId "com.paulusworld.drawernavigationtabs"
        minSdkVersion 15
        targetSdkVersion 23
    /*    multiDexEnabled true*/
    }

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

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile files('libs/android-support-v23.jar')
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:support-v4:23.1.1'
}


build gradle(project navigationtab)


buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
+4
source share
2 answers

Having the "multiDexEnabled" parameter set to "true" will be a performance that may work, but it will also hide the real problem. Consider customizing your program, for example, libraries that you include in your project, they can add more than you need ...

, libs, gradle . v4 v7?

compile files('libs/android-support-v23.jar')

, appcompat-v7, support-v4, .

65K .

0
buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.5.0'
}
}

allprojects {
repositories {
    jcenter()
}
}

gradle file,

Uncomment multiDexEnabled true, !

-1

Source: https://habr.com/ru/post/1617403/


All Articles