首页 > 解决方案 > 无法解决:将 google-services 更新到 15.0.0 后 play-services-basement

问题描述

我已将我的应用程序更新为,compileSdkVersion 27我也将所有库更新为gradle plugin3.0.1'play-servicesversion 15.0.0

现在,当我构建应用程序时,它给了我以下错误消息。

无法解决:play-services-basement

我正在使用force 'com.google.android.gms:play-services-basement:15.0.0',我无法理解为什么它给我这个错误信息。

这些是我的 gradle 设置。

    compileSdkVersion 27
    buildToolsVersion "27.0.1"

   defaultConfig {

        applicationId ''
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 285
        multiDexEnabled true
        resConfigs "en"

    }

    resolutionStrategy {

        force 'com.squareup.okhttp:okhttp:2.4.0'
        force 'com.squareup.okhttp:okhttp-urlconnection:2.4.0'
        force 'com.android.support:support-v4:24.1.1'
        force 'com.android.support:cardview-v7:24.1.1'
        force 'com.android.support:appcompat-v7:24.1.1'
        force 'com.android.support:design:24.1.1'
        force 'com.google.android.gms:play-services-ads:15.0.0'
        force 'com.google.android.gms:play-services-location:15.0.0'
        force 'com.google.android.gms:play-services-auth-base:15.0.1'
        force 'com.google.android.gms:play-services-base:15.0.0'
        force 'com.google.android.gms:play-services-maps:15.0.0'
        force 'com.google.android.gms:play-services-identity:15.0.0'
        force 'com.google.android.gms:play-services-wallet:15.0.0'
        force 'com.google.android.gms:play-services-tasks:15.0.0'
        force 'com.google.android.gms:play-services-basement:15.0.0'
        force 'com.google.firebase:firebase-common:15.0.0'
        force 'com.google.android.gms:play-services-base:15.0.0'
    }


    dependencies {

    implementation 'com.android.support:cardview-v7:27.1.1'

    implementation 'com.google.android.gms:play-services-maps:15.0.0'
    implementation 'com.google.android.gms:play-services-analytics:15.0.0'
    implementation 'com.google.android.gms:play-services-location:15.0.0'
    implementation 'com.google.firebase:firebase-appindexing:15.0.0'
    implementation 'com.google.android.gms:play-services-auth:15.0.0'
    implementation 'com.google.android.gms:play-services-auth-base:15.0.0'
        implementation 'com.google.android.gms:play-services-panorama:15.0.0'
    implementation 'com.google.android.gms:play-services-ads:15.0.0'
    implementation('com.google.firebase:firebase-messaging:15.0.0') {
        exclude group: 'com.android.support', module: 'support-v4'
        exclude group: 'com.android.support', module: 'support-annotations'
    }
    implementation 'com.google.firebase:firebase-core:15.0.0'

    implementation 'org.jsoup:jsoup:1.8.3'

    }

Gradle 包装器属性

distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

构建.gradle

dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'
    classpath 'com.google.gms:google-services:3.2.0'

标签: androidperformancefirebaseandroid-gradle-plugin

解决方案


我在编译我的项目时遇到了同样的错误,尽管我没有直接包含对play-services-basement. 为我解决的问题是我将所有其他依赖项更新到最新版本并重新同步 Gradle。


推荐阅读