是的,我知道这听起来很罕见,但是当 gradle 运行时,会在任务 ':app:checkDebugDuplicateClasses' 和 'com.google.zxing.*' 中给出重复依赖项。显然,一个颤振包使用com.github.leyan95:android-zxingLibrary:0.1.2-PRE,另一个使用com.google.zxing:core:3.3.3,并且两者都具有com.google.zxing.BarcodeFormat其他类别。
这是输出:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class com.google.zxing.BarcodeFormat found in modules jetified-android-zxingLibrary-0.1.2-PRE-runtime.jar (com.github.leyan95:android-zxingLibrary:0.1.2-PRE) and jetified-core-3.3.3.jar (com.google.zxing:core:3.3.3)
Duplicate class com.google.zxing.Binarizer found in modules jetified-android-zxingLibrary-0.1.2-PRE-runtime.jar (com.github.leyan95:android-zxingLibrary:0.1.2-PRE) and jetified-core-3.3.3.jar (com.google.zxing:core:3.3.3)
Duplicate class com.google.zxing.BinaryBitmap found in modules jetified-android-zxingLibrary-0.1.2-PRE-runtime.jar (com.github.leyan95:android-zxingLibrary:0.1.2-PRE) and jetified-core-3.3.3.jar (com.google.zxing:core:3.3.3)
Duplicate class com.google.zxing.ChecksumException found in modules jetified-android-zxingLibrary-0.1.2-PRE-runtime.jar (com.github.leyan95:android-zxingLibrary:0.1.2-PRE) and …Run Code Online (Sandbox Code Playgroud)