Android Error in API 19

0

I have an error in Android Studio with an APP that I do not know about. I commented that if I run it on a device with Android 6.0.1. API 23 runs fine, but on an Android 4.4.2 device. API 19 pulls me wrong.

I have attached the gradle code and the error

GRADLE

dexOptions {
        preDexLibraries = false
    }

    compileSdkVersion 22
    buildToolsVersion '21.0.1'
    defaultConfig {
        applicationId "com.desarrollostello.gesis.gesise"
        minSdkVersion 19
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile('org.apache.httpcomponents:httpcore:4.4.1') {
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
    }
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.github.bumptech.glide:glide:3.6.1'
    compile 'com.android.support:appcompat-v7:22.1.0'
    testCompile 'junit:junit:4.12'
    compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'
    compile('org.apache.httpcomponents:httpmime:4.3') {
        exclude module: "httpclient"
    }

Error in an API device 19

Error:Error converting bytecode to dex:
Cause: java.lang.IllegalArgumentException: already added: Lorg/apache/http/MessageConstraintException;
Error:1 error; aborting
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException
Information:BUILD FAILED
Information:Total time: 1 mins 36.115 secs
Information:3 errors

THANK YOU !!!

    
asked by desarrollosTELLO 02.03.2017 в 22:18
source

1 answer

1

You have a duplicate dependency org.apache.httpcomponents:httpmime with different versions. You will have to leave one of the two, because having both of them generates conflicts.

Of these two, delete some:

compile('org.apache.httpcomponents:httpmime:4.3') {
        exclude module: "httpclient"
    }

compile('org.apache.httpcomponents:httpcore:4.4.1') {
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
    }
    
answered by 03.03.2017 в 13:26