Gradle 同步失败 - play-services-measurement-base 正在被各种其他库请求
Gradle sync fails - play-services-measurement-base is being requested by various other libraries
添加“实现 'com.google.android.gms:play-services-ads:17.0.0'”库后,我遇到了这个问题。我尝试将每个依赖项升级到最新版本,但没有成功。
The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 16.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
这是我的 build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.hussain.podcastapp"
minSdkVersion 23
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'
}
}
dataBinding {
enabled = true
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
def room_version = "1.1.1"
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.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.github.devlight.navigationtabstrip:navigationtabstrip:1.0.4'
implementation 'com.squareup.retrofit2:converter-simplexml:2.3.0'
implementation 'com.github.florent37:glidepalette:2.1.2'
implementation 'com.android.support:palette-v7:27.1.1'
implementation 'com.android.support:design:28.0.0'
implementation 'com.airbnb.android:lottie:2.6.1'
implementation "com.mikepenz:materialdrawer:6.0.9"
implementation 'com.google.android.exoplayer:exoplayer-core:2.8.1'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.8.0'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.8.1'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.github.bumptech.glide:glide:4.8.0'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation "android.arch.persistence.room:runtime:$room_version"
annotationProcessor "android.arch.persistence.room:compiler:$room_version"
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.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 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.google.android.gms:play-services-ads:17.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
}
apply plugin: 'com.google.gms.google-services'
和
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.google.gms:google-services:4.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
依赖项已更新为最新版本。
添加“实现 'com.google.android.gms:play-services-ads:17.0.0'”库后,我遇到了这个问题。我尝试将每个依赖项升级到最新版本,但没有成功。
The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 16.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
这是我的 build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.hussain.podcastapp"
minSdkVersion 23
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'
}
}
dataBinding {
enabled = true
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
def room_version = "1.1.1"
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.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.github.devlight.navigationtabstrip:navigationtabstrip:1.0.4'
implementation 'com.squareup.retrofit2:converter-simplexml:2.3.0'
implementation 'com.github.florent37:glidepalette:2.1.2'
implementation 'com.android.support:palette-v7:27.1.1'
implementation 'com.android.support:design:28.0.0'
implementation 'com.airbnb.android:lottie:2.6.1'
implementation "com.mikepenz:materialdrawer:6.0.9"
implementation 'com.google.android.exoplayer:exoplayer-core:2.8.1'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.8.0'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.8.1'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.github.bumptech.glide:glide:4.8.0'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation "android.arch.persistence.room:runtime:$room_version"
annotationProcessor "android.arch.persistence.room:compiler:$room_version"
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.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 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.google.android.gms:play-services-ads:17.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
}
apply plugin: 'com.google.gms.google-services'
和
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.google.gms:google-services:4.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
依赖项已更新为最新版本。