添加时应用gradle错误(应用插件:' com.google.gms.google-services')

时间:2017-09-29 15:00:18

标签: android

app level gradle

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    //compile 'com.android.support:support-v4:23.1.1'
    //compile 'com.android.support:mediarouter-v7:23.1.1'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.google.android.gms:play-services-drive:10.0.1'
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    compile 'com.google.android.gms:play-services-maps:10.0.0'
    compile 'com.google.android.gms:play-services-location:10.0.1'
    compile 'com.android.support:design:23.4.0'
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
    compile 'com.google.android.gms:play-services-ads:10.0.1'
}
apply plugin: 'com.google.gms.google-services'

当我删除apply(插件:' com.google.gms.google-services')时没有问题但是在添加之后我得到了(错误:任务执行失败':app :processDebugGoogleServices'

  

请通过更新google-services插件的版本(https://bintray.com/android/android-tools/com.google.gms.google-services/提供有关最新版本的信息)或将com.google.android.gms的版本更新为10.0.1来修复版本冲突。)

root level gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'
        classpath 'com.google.gms:google-services:3.1.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
}

0 个答案:

没有答案