Gradle同步失败-其他各种库都在请求play-services-measurement-base

时间:2018-10-10 08:40:00

标签: android android-studio gradle android-gradle google-play-services

添加“实现'com.google.android.gms:play-services-ads:17.0.0'”库后,出现了此问题。我尝试将每个依赖项升级到最新版本,但是没有运气。

  

各种其他库都在[[15.0.1,15.0.1]]请求库com.google.android.gms:play-services-basement,但解析为16.0.1。禁用插件,并使用./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
}

依赖项已更新为最新版本。

1 个答案:

答案 0 :(得分:1)

尝试添加:

com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

紧接着在build.gradle的底部:

apply plugin: 'com.google.gms.google-services'

选中this link

还有this link。版本可能有相同的问题。