由于存在程序类型,因此无法构建APK:org.apache.http.ConnectionClosedException

时间:2018-10-04 11:46:13

标签: android android-studio gradle build-error

我无法为我的应用构建APK,因为它出现以下错误-

程序类型已存在:org.apache.http.ConnectionClosedException

其他人也问了同样的问题。但是,未指定解决方案。相同的链接是-

[Android Studio 3.1 ]Program type already present: org.apache.http.ConnectionClosedException Message

gradle中的依赖项如下-

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
    maven { url "https://maven.google.com" }
    google()
}

android {
    /* splits {
         abi {
             enable true
             reset()
             include 'x86', 'armeabi-v7a'
             universalApk true
         }
     }*/
}
android {

    signingConfigs {
        config1 {
        }
        config {
            keyAlias 'nukad'
            keyPassword 'sanganan'
            storeFile file('/home/rajesh/Android Project/keystore files/releasenukadkeystore1.jks')
            storePassword 'sanganan'
        }
    }
    compileSdkVersion 26
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "com.sanganan.app"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 35
        versionName '5.8'
        multiDexEnabled true
        signingConfig signingConfigs.config
        //test version 3.1.2

    }

    aaptOptions {
        cruncherEnabled = false
    }

    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
        exclude 'org/apache/http/version.properties'
        exclude 'org/apache/http/client/version.properties'
    }

    buildTypes {

        release {
            shrinkResources true
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.config
            proguardFile '/home/rajesh/Android Project/nukad/mynukad_android/app/app/proguard-rules.pro'
        }

    }
    dexOptions {
        dexOptions {
            javaMaxHeapSize "4g"
        }
    }
    sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/2'] } }
    productFlavors {
    }

    lintOptions {
        abortOnError false
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:support-v4:26.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.mcxiaoke.volley:library:1.0.19'
    implementation 'com.android.support:multidex:1.0.1'
    implementation 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.google.firebase:firebase-core:10.2.1'
    implementation 'com.google.firebase:firebase-messaging:10.2.1'
    implementation 'de.hdodenhof:circleimageview:2.1.0'
    implementation 'com.daimajia.slider:library:1.1.5@aar'
    implementation 'com.nineoldandroids:library:2.4.0'
    implementation 'me.dm7.barcodescanner:zxing:1.9.4'
    implementation 'commons-io:commons-io:1.3.2'
    implementation 'com.soundcloud.android:android-crop:1.0.1@aar'
    implementation 'com.amazonaws:aws-android-sdk-core:2.2.+'
    implementation 'com.amazonaws:aws-android-sdk-s3:2.2.+'
    implementation 'com.instabug.library:instabug:3+'
    implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.1.3'
    implementation 'com.github.bumptech.glide:glide:3.8.0'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    implementation 'com.google.api-client:google-api-client:1.25.0'
    implementation 'com.google.apis:google-api-services-youtube:v3-rev205-1.25.0'
    implementation 'com.google.android.gms:play-services-auth:10.2.1'
    implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true;
    }
    implementation 'com.wang.avi:library:2.1.3'
    implementation files('libs/YouTubeAndroidPlayerApi.jar')
}
apply plugin: 'com.google.gms.google-services'

0 个答案:

没有答案