gpt4 book ai didi

android - 什么是 "Program type already present"?

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:43:36 25 4
gpt4 key购买 nike

当我尝试构建我的项目时,我遇到了这个错误

Program type already present: android.support.v4.accessibilityservice.AccessibilityServiceInfoCompat Message{kind=ERROR, text=Program type already present: android.support.v4.accessibilityservice.AccessibilityServiceInfoCompat, sources=[Unknown source file], tool name=Optional.of(D8)}

我也在堆栈溢出中找到解决方案,但它没有帮助。这是我的 build.gradle 文件

    apply plugin: 'com.android.application'android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.hassan.qrscan"
minSdkVersion 18
targetSdkVersion 28
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(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'me.dm7.barcodescanner:zxing:1.9'
implementation 'com.journeyapps:zxing-android-embedded:3.0.2@aar'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'}

最佳答案

程序类型已存在错误每当您的项目具有重复的库或具有不同版本的相同库时都会出现。您可以通过运行检查依赖关系图

gradlew -q dependencies

gradle -q dependencies

(在你的类路径中需要 Gradle)

只需整理出重复的库,删除重复的库,错误就会消失。

关于android - 什么是 "Program type already present"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52561384/

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