无法解决:将google-services更新为15.0.0后播放play-services-basement

时间:2018-10-11 19:35:21

标签: android performance firebase android-gradle

我已将我的应用更新为compileSdkVersion 27,也将gradle plugin更新为3.0.1',并将所有play-services库更新为version 15.0.0

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

  

无法解决:播放服务库

我正在使用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-wrapper-properties

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

build.gradle

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

1 个答案:

答案 0 :(得分:0)

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