Android 创建Google Maps活动后出现Gradle生成错误

Android 创建Google Maps活动后出现Gradle生成错误,android,android-studio,gradle,Android,Android Studio,Gradle,我在android studio中的项目中添加了一个空的google maps活动,但收到以下错误消息: 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 ve

我在android studio中的项目中添加了一个空的google maps活动,但收到以下错误消息:

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 10.0.1.
我的应用程序级别build.gradle文件包含:

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
    applicationId "XXXXXXXXXX"
    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'
})
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.android.support:design:25.1.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android.gms:play-services-maps:10.2.0'
testCompile 'junit:junit:4.12'
}







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 {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.3.0'
    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
我的项目级build.gradle文件包含:

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
    applicationId "XXXXXXXXXX"
    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'
})
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.android.support:design:25.1.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android.gms:play-services-maps:10.2.0'
testCompile 'junit:junit:4.12'
}







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 {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.3.0'
    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

我如何解决这个问题?感谢您的帮助,谢谢。

不要使用
编译com.google.android.gms:play services maps:10.2.0'
使用此
编译com.google.android.gms:play services maps:10.0.1'
而不要使用
编译com.google.android.gms:play services maps:10.2.0'
使用此
编译com.google.android.gms:play services maps:10.0.1'
更新包
com.google.firebase:firebase auth:10.0.1
com.google.firebase:firebase auth:10.2.0


您应该尝试使用基于play services的相同版本的库以避免冲突

将包
com.google.firebase:firebase auth:10.0.1
更新到
com.google.firebase:firebase auth:10.2.0


您应该尝试使用基于play services的相同版本的库以避免冲突

错误显示您的应用程序中存在与新版本冲突的play services的另一版本,如果您使用过google play services jar,请确保没有其他依赖项从libs中接收任何google play services jar,这可能与firebase auth lib的版本有关,您应该尝试使用基于play services的相同版本的库。我不确定您的意思,但我只是在创建活动之前在SDK管理器中安装了Google play services SDK。错误显示您的应用程序中存在与新版本冲突的play services的另一版本,如果您使用过google play services jar,请确保没有其他依赖项从libs中接收任何google play services jar,这可能与firebase auth lib的版本有关,您应该尝试使用基于play services的相同版本的库。我不确定您的意思,但我只是在创建活动之前在SDK管理器中安装了Google play services SDK。