gpt4 book ai didi

android - 添加指示重复类的新依赖项后项目构建失败

转载 作者:行者123 更新时间:2023-11-29 23:08:32 26 4
gpt4 key购买 nike

我在我的应用程序上工作一切都很好,直到我想添加一个条形码扫描器,当我添加这个 implementation 'info.androidhive:barcode-reader:1.1.5'

我的应用程序开始构建失败并出现此错误:

Duplicate class android.support.design.widget.CoordinatorLayout found in 
modules classes.jar (com.android.support:coordinatorlayout:28.0.0) and
classes.jar (com.android.support:design:27.0.0)
Duplicate class android.support.design.widget.CoordinatorLayout$1 found in
modules classes.jar (com.android.support:coordinatorlayout:28.0.0) and
classes.jar (com.android.support:design:27.0.0)
Duplicate class android.support.design.widget.CoordinatorLayout$Behavior
found in modules classes.jar (com.android.support:coordinatorlayout:28.0.0)
and classes.jar (com.android.support:design:27.0.0)
Duplicate class
android.support.design.widget.CoordinatorLayout$DefaultBehavior found in
modules classes.jar (com.android.support:coordinatorlayout:28.0.0) and
classes.jar (com.android.support:design:27.0.0)
Duplicate class
android.support.design.widget.CoordinatorLayout$DispatchChangeEvent found in
modules classes.jar (com.android.support:coordinatorlayout:28.0.0) and
classes.jar (com.android.support:design:27.0.0)
Duplicate class
android.support.design.widget.CoordinatorLayout$HierarchyChangeListener
found in modules classes.jar (com.android.support:coordinatorlayout:28.0.0)
and classes.jar (com.android.support:design:27.0.0)
Duplicate class android.support.design.widget.CoordinatorLayout$LayoutParams
found in modules classes.jar (com.android.support:coordinatorlayout:28.0.0)
and classes.jar (com.android.support:design:27.0.0)
Duplicate class
android.support.design.widget.CoordinatorLayout$OnPreDrawListener found in
modules classes.jar (com.android.support:coordinatorlayout:28.0.0) and
classes.jar (com.android.support:design:27.0.0)
Duplicate class android.support.design.widget.CoordinatorLayout$SavedState
found in modules classes.jar (com.android.support:coordinatorlayout:28.0.0)
and classes.jar (com.android.support:design:27.0.0)
Duplicate class android.support.design.widget.CoordinatorLayout$SavedState$1
found in modules classes.jar (com.android.support:coordinatorlayout:28.0.0)
and classes.jar (com.android.support:design:27.0.0)
Duplicate class
android.support.design.widget.CoordinatorLayout$ViewElevationComparator
found in modules classes.jar (com.android.support:coordinatorlayout:28.0.0)
and classes.jar (com.android.support:design:27.0.0)

Go to the documentation to learn how to Fix dependency resolution errors.

当然,Go to Documentation 链接不会带我去任何地方。

这也是我的 gradle 依赖项:

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.jakewharton:butterknife:9.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.android.gms:play-services-vision:17.0.2'
implementation 'org.jetbrains:annotations-java5:15.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.1.0'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation `'info.androidhive:barcode-reader:1.1.5'`
}

当我删除 'info.androidhive:barcode-reader:1.1.5' 依赖项时,它构建良好(但我需要它)。我不知道要删除什么或做什么,欢迎任何提示。

最佳答案

当我显式添加这个依赖时,问题就解决了:

implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'

关于android - 添加指示重复类的新依赖项后项目构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56299201/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com