Google Play服务要求“更新”回9.0.0

时间:2017-04-24 14:25:26

标签: java android gradle

为什么我会问,在每个解决方案中,我都会在底部有适用插件的信息,但我有这个,但这不适合我。我试着在5个小时内做到这一点。我试图在我的应用程序上实现谷歌地图后得到错误。也许我想念代码中的东西?我不知道问题出在哪里,所以请大家看看代码,也许你会有任何想法是错的。谢谢你的建议。

这是错误:

   Error:Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.



 apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.company.andrzej.rolki.wroclawnarolkach"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    configurations.all {
        resolutionStrategy.force 'com.android.support:support-annotations:22.1.0'
    }
    apply plugin: 'com.google.gms.google-services'
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.firebase:firebase-ads:10.2.1'
    compile 'com.jakewharton:butterknife:8.5.1'
    compile 'com.android.support:support-v4:25.3.1'
    compile 'com.google.android.gms:play-services-maps:10.2.1'
    testCompile 'junit:junit:4.12'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
    compile 'com.google.firebase:firebase-crash:10.2.1'
    compile 'com.google.firebase:firebase-core:10.2.1'
    compile 'com.google.android.gms:play-services-analytics:10.2.1'
    compile 'com.google.android.gms:play-services-gcm:10.2.1'
    compile 'com.google.android.gms:play-services-location:10.2.1'
}

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

和项目

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.1'
        classpath 'com.google.gms:google-services:3.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

1 个答案:

答案 0 :(得分:1)

apply plugin: 'com.google.gms.google-services'块中删除dependencies行。你写了两次。