android – Program type already present:

Exception or error:

I try using zxing library to scan a qrcode, there’s no error until I run the app like this:

Program type already present:

Message{kind=ERROR, text=Program type already present:, sources=[Unknown source file], tool name=Optional.of(D8)}

enter image description here

here’s my gradle:

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.std.scanner"
        minSdkVersion 18
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner ""
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), ''

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation ''
    implementation ''
    implementation 'com.journeyapps:zxing-android-embedded:3.6.0'

i think i should using “exclude” in my gradle dependecies, but I don’t know how to write the code. please help, thanks in advance.

How to solve:

I was getting the same error except it was the
Turned out i had the BarcodeFormat in the app from a .jar library i had in /libs.

Have you tried searching for ChecksumException class in you app by pressing
Ctrl + N and typing “ChecksumException” ?


My mistake was i added a plugin (qrcode) in pubspec.yml which overwrite another class defined from another plugin (animated_qr_code_scanner), and then exist a conflict between plugins (and classes).
You can try comenting the last added plugin to locate the used classes.


solve by add in build.gradle (app)

configurations {
compile.exclude group: ''


Leave a Reply

Your email address will not be published. Required fields are marked *