我正在尝试将以下依赖项添加到我的应用程序级别gradle文件中
player-service-cast-framework:16.2.0但在构建时出现错误。
下面是我在应用程序级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.amitshekhar.android:android-networking:1.0.2'
implementation 'com.google.android.exoplayer:exoplayer:2.8.4'
implementation 'com.github.HaarigerHarald:android-youtubeExtractor:v1.7.0'
implementation "com.android.support:mediarouter-v7:28.0.0"
implementation 'com.google.android.gms:play-services-cast-framework:16.2.0'
implementation "com.android.support:recyclerview-v7:28.0.0"
implementation 'com.android.support:cardview-v7:28.0.0'
implementation "com.github.bumptech.glide:glide:4.9.0"
annotationProcessor "com.github.bumptech.glide:compiler:4.9.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.android.support:appcompat-v7:28.0.0'
发布于 2019-08-17 14:38:38
这是因为您使用的是旧的android.support库。您应该使用的是AndroidX库。因此,请替换您的:
implementation 'com.android.support:appcompat-v7:28.0.0'有了这个:
implementation 'androidx.appcompat:appcompat:1.0.2'但这不是你唯一的错误。由于您使用了大量的android.support依赖项,因此我假设您使用的是一个旧项目,因此请查看以下内容:Migrate to AndroidX。所有旧的依赖项现在都有了新的实现。
https://stackoverflow.com/questions/57533432
复制相似问题