Reputation: 848
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.
Upvotes: 5
Views: 7828
Reputation: 324
solve by add in build.gradle (app)
configurations {
implementation.exclude group: 'com.google.zxing'
}
Upvotes: 8
Reputation: 1474
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.
Upvotes: 1
Reputation: 253
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" ?
Upvotes: 7