Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/225.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 添加com.google.gms.google-services时gradle中的版本冲突_Android_Android Gradle Plugin_Build.gradle - Fatal编程技术网

Android 添加com.google.gms.google-services时gradle中的版本冲突

Android 添加com.google.gms.google-services时gradle中的版本冲突,android,android-gradle-plugin,build.gradle,Android,Android Gradle Plugin,Build.gradle,我使用助手将firebase云消息添加到我的项目中,在android studio构建项目时遇到以下错误消息: 错误:任务“:app:processDebugGoogleServices”的执行失败。 请通过更新的版本来修复版本冲突 谷歌服务插件(关于最新版本的信息 可在 ) 或者将com.google.android.gms的版本更新为9.8.0 以下是生成文件: 顶级: // Top-level build file where you can add configuration optio

我使用助手将firebase云消息添加到我的项目中,在android studio构建项目时遇到以下错误消息:

错误:任务“:app:processDebugGoogleServices”的执行失败。 请通过更新的版本来修复版本冲突 谷歌服务插件(关于最新版本的信息 可在 ) 或者将com.google.android.gms的版本更新为9.8.0

以下是生成文件:

顶级:

// 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'  

        // NOTE: Do not place your application dependencies here; they belong  
        // in the individual module build.gradle files  
        classpath 'com.google.gms:google-services:3.0.0'  
    }  
}  

allprojects {  
    repositories {  
        jcenter()  
    }  
}  

task clean(type: Delete) {  
    delete rootProject.buildDir  
}  
应用程序级别:

apply plugin: 'com.android.application'  

android {  
        compileSdkVersion 25  
        buildToolsVersion "25.0.0"  
        defaultConfig {  
        applicationId "in.ac.iitb.treeplantationapp"  
        minSdkVersion 21  
        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.0.1'  
    compile 'com.android.volley:volley:1.0.0'  
    compile 'com.android.support:design:25.0.1'  
    compile 'com.google.android.gms:play-services-appindexing:9.8.0'  
    compile 'com.google.android.gms:play-services:10.0.0'  
    compile 'com.squareup.picasso:picasso:2.5.2'  
    compile 'com.google.firebase:firebase-messaging:10.0.1'  
    testCompile 'junit:junit:4.12'  
}  


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

您正在使用不同版本的google play服务:

compile 'com.google.android.gms:play-services-appindexing:9.8.0'  
compile 'com.google.android.gms:play-services:10.0.0'
compile 'com.google.firebase:firebase-messaging:10.0.1'    
使用:


在sdk工具中更新您的google存储库
compile 'com.google.android.gms:play-services-appindexing:10.0.1'  
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'