执行失败':app:transformClassesWithJarMergingForDebug'重复条目:android / support / v4 / graphics / drawable / DrawableCompat.class

时间:2017-09-15 18:32:50

标签: android android-drawable

我有这个问题。我该如何解决?

的build.gradle:

apply plugin: 'com.android.application'

android {
    useLibrary 'org.apache.http.legacy'
    compileSdkVersion 25
    buildToolsVersion "25.0.3"
    configurations {
        all*.exclude group: 'com.android.support', module: 'support-v4' }


    defaultConfig {
        applicationId "com.solodroid.ecommerce"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile files('libs/android-support-v4.jar')
    compile files('libs/Parse-1.3.0.jar')
    compile files('libs/signpost-commonshttp4-1.2.1.2.jar')
    compile files('libs/signpost-core-1.2.1.2.jar')
    compile files('libs/signpost-jetty6-1.2.1.2.jar')
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support:appcompat-v7:25.3.1'
}

1 个答案:

答案 0 :(得分:1)

TODO:

  • 删除configurations { all*.exclude group: 'com.android.support', module: 'support-v4' }
  • 删除compile fileTree(dir: 'libs', include: ['*.jar'])
  • 将所有Jars转换为Maven依赖项

这里

apply plugin: 'com.android.application'

android {
    useLibrary 'org.apache.http.legacy'
    compileSdkVersion 25
    buildToolsVersion "25.0.3"

    defaultConfig {
        applicationId "com.solodroid.ecommerce"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    compile files('libs/Parse-1.3.0.jar')
    compile files('libs/signpost-commonshttp4-1.2.1.2.jar')
    compile files('libs/signpost-core-1.2.1.2.jar')
    compile files('libs/signpost-jetty6-1.2.1.2.jar')
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support:appcompat-v7:25.3.1'
}