我认识到已经有几个“程序类型已经存在”的问题,但是似乎没有一个问题可以完全解决(或帮助解决)我的情况: 我收到“程序类型已存在:android.support.v7.util.AsyncListUtil $ 1”-我认为这是从exoplayer 2.7更新时开始的。到exoplayer 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'
}
更新:
根据Android Studio- Program type already present: com.google.android.gms.internal.measurement.zzwp
,我开始认为可能与Firebase有关因此在我的代码中删除了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)}
答案 0 :(得分:0)
已解决。就我而言,我在/ libs文件夹中找到了android-support-v4-23.1.1和android-support-v7-recyclerview-23.1.1。在更新exoplayer和Firebase之前,它们并没有引起我问题。删除这些内容使我可以再次编译和部署而不会出错。并不是很确定他们是如何到达那里的,但是我认为它们是从广告中介网络的图书馆软件包安装中遗留下来的。