I try using zxing library to scan a qrcode, there's no error until I run the app like this:
Program type already present: com.google.zxing.ChecksumException
Message{kind=ERROR, text=Program type already present: com.google.zxing.ChecksumException, sources=[Unknown source file], tool name=Optional.of(D8)}
here's my gradle:
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.std.scanner"
minSdkVersion 18
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
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.
solve by add in build.gradle (app)
configurations {
implementation.exclude group: 'com.google.zxing'
}
I was getting the same error except it was the com.google.zxing.BarcodeFormat. 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With