0

The below gradle files are i have used in my application. It works fine with api level 23 but when i update from 23 to 26 i faced this issue. Please help me to resolve this.

// Top-level build file

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
            classpath 'com.android.tools.build:gradle:3.1.0'
    }
}
task wrapper(type: Wrapper) {
    gradleVersion = "3.1.0"
}

allprojects {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        google()
    }
}

and my application gradle file is below. this application gradle is works fine with compile and target sdk as 23.

import java.util.regex.Pattern

apply plugin: 'com.android.application'

android {
    lintOptions {
        abortOnError false
    }
    //compileSdkVersion 21
    compileSdkVersion 26
    flavorDimensions "default"
    defaultConfig {
        applicationId "**********"
        minSdkVersion 14
        targetSdkVersion 26
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-project.txt'
            signingConfig signingConfigs.release
            zipAlignEnabled true
            debuggable false
        }
        debug {
            minifyEnabled false
            zipAlignEnabled true
            debuggable true
        }
    }
    sourceSets {
        main {
            java {
                //
            }
        }
        androidTest {
            java {
            }
        }
    }

    productFlavors {
        devel {
            repositories {
                jcenter()
                maven {
                   url
                }
            }

        }
        stag {
            repositories {
                jcenter()
                maven {
                    url ""
                }
            }

        }

    }

    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/ASL2.0'
    }
    useLibrary 'org.apache.http.legacy'
}
dependencies {
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:recyclerview-v7:26.1.0'

    implementation 'org.apache.httpcomponents:httpclient-android:4.3.5'
    implementation('org.apache.httpcomponents:httpmime:4.3.5') {
        exclude module: 'org.apache.httpcomponents:httpclient'
    }
    implementation 'com.google.android.gms:play-services-plus:11.8.0'
    implementation 'com.google.android.gms:play-services-analytics:11.8.0'
    implementation 'com.google.android.gms:play-services-maps:11.8.0'
    implementation 'com.google.android.gms:play-services-location:11.8.0'
    implementation "com.splunk.mint:mint:4.4.0"
}
repositories {
    maven {
        url "https://mint.splunk.com/gradle/"
    }
}
}
Milind Mevada
  • 3,145
  • 1
  • 14
  • 22
karthik
  • 321
  • 1
  • 8
  • 21
  • Possible duplicate of [What does "Program type already present" mean?](https://stackoverflow.com/questions/49676155/what-does-program-type-already-present-mean) – 2Dee Jul 24 '18 at 09:06
  • @2Dee Hi Thanks for reply, I had also added exclude module: 'org.apache.httpcomponents:httpclient' but still getting error. – karthik Jul 24 '18 at 10:28
  • @karthik how you resolved? – Star Aug 02 '19 at 14:56

0 Answers0