首页 > 解决方案 > Android 程序类型已存在:BufferOverflowException

问题描述

我在 Android Studio 3.2.1 上开发了一个 Android 应用程序,并导入了 aar 模块来读取阿联酋身份证,我可以在我的设备上毫无问题地运行该应用程序。

我尝试为我的应用程序生成一个 APK(调试/签名)文件,但出现此错误:

Program type already present: com.acs.smartcard.BufferOverflowException

其中 com.acs.smartcard 是模块包名称。

我的应用程序 build.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' }

}


android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "biz.wasel.driver"
        minSdkVersion 17
        targetSdkVersion 28
        versionCode 3
        versionName "1.0.4"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    dataBinding {
        enabled = true
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.android.support:support-annotations:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.google.firebase:firebase-database:16.0.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test:rules:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-intents:3.0.2'

    implementation 'android.arch.lifecycle:extensions:1.1.1'

    implementation 'com.android.volley:volley:1.1.0'

    implementation 'com.google.code.gson:gson:2.8.4'

    implementation 'com.squareup.picasso:picasso:2.71828'

    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.google.android.gms:play-services-location:15.0.1'

    implementation 'com.android.support:design:28.0.0'

    implementation 'com.google.firebase:firebase-messaging:17.0.0'

    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

    implementation 'com.github.dmytrodanylyk.circular-progress-button:library:1.1.3'

    implementation 'me.philio:pinentryview:1.0.6'
    implementation 'com.poovam:pin-edittext-field:1.0.3'

    implementation 'com.android.support:support-compat:28.0.0'
    implementation 'com.daimajia.easing:library:2.0@aar'
    implementation 'com.daimajia.androidanimations:library:2.3@aar'

    implementation 'com.aurelhubert:ahbottomnavigation:2.1.0'

    implementation 'de.hdodenhof:circleimageview:2.2.0'

    implementation 'com.ramotion.cardslider:card-slider:0.2.0'

    implementation 'com.android.support:preference-v7:28.0.0'

    implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'

    implementation 'com.yarolegovich:discrete-scrollview:1.4.7'

    implementation 'net.gotev:uploadservice:3.4.2'

    implementation 'com.github.esafirm.android-image-picker:imagepicker:1.13.1'

    implementation 'android.arch.paging:runtime:1.0.0'

    implementation 'com.github.ome450901:SimpleRatingBar:1.4.2'
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.4@aar') {
        transitive = true;
    }

    implementation 'id.zelory:compressor:2.1.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.github.gmazzo:nestedscroll-maps:0.4'
    implementation 'com.hanks.animatecheckbox:library:0.1'
    implementation 'com.sothree.slidinguppanel:library:3.4.0'
    implementation 'com.hbb20:ccp:2.1.2'
    implementation 'com.github.Binary-Finery:Bungee:master-SNAPSHOT'
    implementation 'com.github.gcacace:signature-pad:1.2.1'
    implementation 'com.facebook.shimmer:shimmer:0.1.0@aar'

    implementation project(':acs-plugin-release')
    implementation project(':EIDAToolkit')
}
apply plugin: 'com.google.gms.google-services'

我的项目级别 build.gradle 是

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.0.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }
        maven { url 'http://maven.microblink.com' }


    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

注意:当我评论

implementation project(':acs-plugin-release')

form app build.gradle 我可以毫无问题地生成 APK,但我需要这个模块来完成应用程序。我从这里这里尝试了很多解决方案,但没有奏效!

请问有什么帮助吗?!

谢谢

标签: androidandroid-studio

解决方案


推荐阅读