当我尝试构建我的项目时,我收到此错误
程序类型已存在:android.support.v4.accessibilityservice.AccessibilityServiceInfoCompat
Message{kind=ERROR,text=程序类型已存在:android.support.v4.accessibilityservice.AccessibilityServiceInfoCompat,sources=[未知源文件],工具名称=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
or
gradle -q dependencies
(类路径中需要 Gradle)
只要整理出重复的库,删除重复的库,错误就会消失。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)