已存在的程序类型:com.google.zxing.ChecksumException

mag*_*kir 4 android qr-code zxing

我尝试使用zxing库来扫描qrcode,在我运行这样的app之前没有错误:

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)}
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

这是我的傻瓜:

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'
}
Run Code Online (Sandbox Code Playgroud)

我想我应该在我的gradle dependecies中使用"exclude",但我不知道如何编写代码.请帮助,提前谢谢.

Yud*_*rma 8

通过添加 build.gradle (app) 解决

configurations {
    implementation.exclude group: 'com.google.zxing'
}
Run Code Online (Sandbox Code Playgroud)


Gud*_*all 7

除了com.google.zxing.BarcodeFormat之外,我收到了同样的错误.原来,我在/ libs中的.jar库中的应用程序中有BarcodeFormat.

您是否尝试通过按Ctrl + N并键入"ChecksumException"在您的应用中搜索ChecksumException类?