我认识到已经有几个"程序类型已经存在"的问题,但似乎没有一个能完全解决(或帮助)我的情况: 我得到"程序类型已经存在:android.support.v7.util.AsyncListUtil$1" - 我认为这是我从 exoplayer 2.7 更新时开始的。到外星人2.8
Program type already present: android.support.v7.util.AsyncListUtil$1
Message{kind=ERROR, text=Program type already present: android.support.v7.util.AsyncListUtil$1, sources=[Unknown source file], tool name=Optional.of(D8)}
Android Studio一度不再抱怨AsynListUtil,而是开始对Annotations.AnyRef说同样的话
。build.gradle粘贴在下面。 任何帮助将不胜感激。 我已经解决了 Android Studio 标记的任何依赖项/库冲突,并完成了"清理项目>工具"、"重建项目>工具和"文件>使缓存失效/重新启动">
apply plugin: 'com.android.application'
android {
signingConfigs {
release {
keyAlias 'sotdaakey'
keyPassword 'sotdaamerc'
storeFile file('C:/Users/Doug/AndroidStudioProjects/SpeakerDayAA_fromscratch/local files/keystores/android.jks')
storePassword 'sotdmerc'
}
}
compileSdkVersion 27
defaultConfig {
applicationId 'com.hintonworx.speakerdayaa'
minSdkVersion 21
targetSdkVersion 27
versionCode 8
versionName '1.6'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
signingConfig signingConfigs.release
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
flavorDimensions "recovery"
productFlavors {
aa {
//applicationId 'com.hintonworx.speakerday.aa'
applicationId 'com.hintonworx.speakerdayaa'
// must use this because AA version was originally published this way
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}
na {
applicationId 'com.hintonworx.speakerday.na'
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
// make customtabs 27.1.1 explicit, because play-services-ads:15.0.1 uses an earlier version
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.exoplayer:exoplayer:2.8.4'
implementation 'com.google.android.exoplayer:extension-mediasession:2.8.4'
implementation 'com.google.android.exoplayer:extension-ima:2.8.4'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:support-v13:27.1.1'
implementation 'com.jakewharton.timber:timber:4.1.1'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
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 'commons-io:commons-io:2.5'
}
更新:
我开始认为它可能与Firebase有关,如:Android Studio-程序类型已经存在:com.google.android.gms.internal.measurement.zzwp
因此,在我的代码中删除了Firebase依赖项和引用,但仍然得到:
Program type already present: android.support.annotation.AnyRes
Message{kind=ERROR, text=Program type already present: android.support.annotation.AnyRes, sources=[Unknown source file], tool name=Optional.of(D8)}
已解决。 就我而言,我在/libs 文件夹中找到了 android-support-v4-23.1.1 和 android-support-v7-recyclerview-23.1.1。 在更新 exoplayer 和 Firebase 之前,他们并没有给我带来麻烦。 删除它们使我能够再次编译和部署而不会出错。 不完全确定他们最初是如何到达那里的,但我认为他们是从广告中介网络的库包安装中留下的。