java - 更新 android studio 和新的 sdk 后得到 "Error:Execution failed for task ' :app:processDebugGoogleServices'. 我该如何解决?

标签 java android android-studio gradle

这是我尝试构建应用程序时遇到的错误

错误:任务“: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.

这些是我在项目中使用的依赖项

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.0.0'
    compile 'com.android.support:recyclerview-v7:24.0.0'
    compile 'com.android.support:cardview-v7:24.0.0'

    compile('com.mikepenz:materialdrawer:3.1.0@aar') {
        transitive = true
    }
    compile 'com.github.navasmdc:MaterialDesign:1.5@aar'
    compile 'com.nineoldandroids:library:2.4.+'

    compile 'com.google.android.gms:play-services-ads:9.2.0'
    compile 'com.google.android.gms:play-services-appindexing:9.2.0'


    compile 'in.srain.cube:grid-view-with-header-footer:1.0.12'
    compile 'com.quinny898.library.persistentsearch:library:1.1.0-SNAPSHOT'
    compile 'com.github.nirhart:parallaxscroll:1.0'
    compile 'com.github.amlcurran.showcaseview:library:5.4.1'

    compile 'com.getbase:floatingactionbutton:1.10.1'

    compile 'com.google.api-client:google-api-client-android:1.20.0' exclude module: 'httpclient'
    compile 'com.google.http-client:google-http-client-gson:1.20.0' exclude module: 'httpclient'
    compile 'com.google.apis:google-api-services-vision:v1-rev2-1.21.0'

    compile 'com.google.firebase:firebase-core:9.2.0'
    compile 'com.google.firebase:firebase-messaging:9.2.0'

    compile 'me.gujun.android.taggroup:library:1.4@aar'

}

最佳答案

在网上搜索了 2 天后,我终于找到了解决方案。 我将 apply plugin: 'com.google.gms.google-services' 放在我的 build.gradle 文件的末尾。 但是我仍然不明白为什么我把它写在上面时它不起作用。

谷歌可能知道 :P

关于java - 更新 android studio 和新的 sdk 后得到 "Error:Execution failed for task ' :app:processDebugGoogleServices'. 我该如何解决?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38263850/

相关文章:

android - 添加包含其他依赖项的模块依赖项

gradle - 在网络驱动器上进行项目时,编译项目需要30〜分钟

android - 为什么 Navigation Drawer 项目模板 (Studio 3.6.1) 无法在 Android Nougat 上加载正确的 Controller ?

android - 任务 ':app:packageDebug' 执行失败 - 无法读取 zip 文件

java - 降低大型 switch 语句的复杂性

java - AWS DynamoDB 多个 "NE"字符串过滤器?

java 反射 :Avoid warning unchecked call to getConstructor(Class<? >...) 作为原始类型类的成员

java - ClassCastException : Fragment cannot be cast to Fragment

java - 坐标 ArrayList 应该具有相同的大小

java - new File ( path ) 总是说没有文件