user7939485
user7939485

Reputation: 416

Execution failed ':app:transformClassesWithJarMergingForDebug' duplicate entry: android/support/v4/graphics/drawable/DrawableCompat.class

I have this issue. How should I solve it?

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'
}

Upvotes: 0

Views: 68

Answers (1)

Jared Burrows
Jared Burrows

Reputation: 55525

TODO:

  • Remove configurations { all*.exclude group: 'com.android.support', module: 'support-v4' }
  • Remove compile fileTree(dir: 'libs', include: ['*.jar'])
  • Convert all Jars to be Maven dependencies

Here

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'
}

Upvotes: 1

Related Questions