flutter - 使用 qrscan 和 flutter_facebook_auth 在 Flutter 应用程序中重复依赖项
问题描述
是的,我知道这听起来很罕见,但是当 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 jetified-core-3.3.3.jar (com.google.zxing:core:3.3.3)
Duplicate class com.google.zxing.DecodeHintType 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.Dimension 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.EncodeHintType 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.FormatException 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.InvertedLuminanceSource 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.LuminanceSource 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.MultiFormatReader 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.MultiFormatWriter 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.MultiFormatWriter$1 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.NotFoundException 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.PlanarYUVLuminanceSource 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.RGBLuminanceSource 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.Reader 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.ReaderException 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.Result 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.ResultMetadataType 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.ResultPoint 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.ResultPointCallback 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.Writer 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.WriterException 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.aztec.AztecDetectorResult 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.aztec.AztecReader 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.aztec.AztecWriter 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.aztec.decoder.Decoder 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.aztec.decoder.Decoder$1 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.aztec.decoder.Decoder$Table 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.aztec.detector.Detector 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.aztec.detector.Detector$Point 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.aztec.encoder.AztecCode 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.aztec.encoder.BinaryShiftToken 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.aztec.encoder.Encoder 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.aztec.encoder.HighLevelEncoder 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.aztec.encoder.HighLevelEncoder$1 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)...
(and so on with every class of the dependency com.google.zxing)
Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 14s
Exception: Gradle task assembleDebug failed with exit code 1
关于从哪里开始寻找解决方案的任何想法?
解决方案
我找到了解决方案,我唯一需要做的就是将下一行添加到 gradle
configurations.all {
exclude group: 'com.google.zxing', module: 'core'
}
希望解决方案可以帮助其他人。
推荐阅读
- azure - 将 .Net Core 应用程序设置作为环境变量发送到 kubernetes pod
- php - 如何将 WhatsApp 分享按钮添加到 PHP 网站?
- maven - Alfresco HotSwapAgent 额外类
- initialization - 多次重新加载fancytree的问题
- python - 有没有办法将 H2O 部分相关绘图结果保存为数据框?
- typescript - 在没有模块的情况下使用 TypeScript、Mocha 和 Chai
- c++ - 最大的回文产品 - 程序未运行,编写解决方案但无法理解问题
- python - 无法理解 perl 中的正则表达式修饰符以转换为 python
- scala - Scala - 如何在 Spark 的 map 函数中实现 Try
- c++ - c ++构造函数将1个字符串参数转换为3个属性