1

I developed an Android application on Android Studio 3.2.1 and I imported aar module to read UAE Id cards, I can run the application on my device without any problem.

I tried to generate an APK (debug/signed) file for my application but I get this error:

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

where com.acs.smartcard is the module package name.

My app build.gradle file:

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'

and my project level build.gradle is

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
}

Note: When I commented

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

form app build.gradle I can generate APK without any problem, but I need this module to finish the app. I tried a lot of solutions from here and here, but they didn't work!

Any help, please ?!

Thank you

Ahmed M. Abed
  • 599
  • 3
  • 9
  • 22

0 Answers0