将google服务从9.0.0更新到10.0.1 Android studio 2.2 [英] update google services from 9.0.0 to 10.0.1 Android studio 2.2

查看:98
本文介绍了将google服务从9.0.0更新到10.0.1 Android studio 2.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到一个错误消息:

错误:任务':app:processDebugGoogleServices'执行失败。


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


我试着看 https://bintray.com/android/android-tools/com.google.gms。 google-services / 和com.google.gms:google-services:3.0.0似乎是最新的。这是我的项目gradle

  buildscript {
repositories {
jcenter()
}
依赖关系{
classpath'com.android.tools.build:gradle:2.2.3'
classpath'com.google.gms:google-services:3.0.0'


//注意:不要在这里放置应用程序依赖关系;它们属于单个模块build.gradle文件中的
//
}
}

allprojects {
存储库{
jcenter()



任务清理(类型:删除){
删除rootProject.buildDir
}

这就是我的应用程序gradle的样子

 应用插件:'com.android.application'


android {
compileSdkVersion 23
buildToolsVersion23.0.1
defaultConfig {
applicationIdsk.tipos.paradox02.citaj
minSdkVersion 11
targetSdkVersion 23
versionCode 27
versionName'2.003'
}


buildTypes {
release {
minifyEnabled false
multiDexEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
// signedConfig标志ingConfigs.release


debug {
debuggable true
minifyEnabled false
multiDexEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt' )
// signingConfig signingConfigs.release
}
}


productFlavors {
}

lintOptions {

checkReleaseBuilds false



$ b依赖关系{
编译fileTree(包括:['* .jar'] ,dir:'libs')
testCompile'junit:junit:4.12'
compile'c​​om.google.gms:google-services:3.0.0'
compile'c​​om.android.support :appcompat-v7:23.1.0'
compile'c​​om.android.support:design:23.1.0'
compile'c​​om.google.android.gms:play-services:10.2.0'
编译'com.google.android.gms:play-services-ads:10.2.0'
compile'c​​om.google.android.gms:play-services-appindexi ng:9.8.0'
compile'c​​om.google.android.gms:play-services-analytics:10.2.0'

compile'c​​om.google.firebase:firebase-core: 9.0.0'
compile'c​​om.google.firebase:firebase-crash:10.0.1'
compile'c​​om.google.firebase:firebase-ads:10.0.1'
compile' com.android.support:multidex:1.0.1'
}

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



如果我将播放服务更改为9.0.0,则所有编译都可以正常进行。我在这里错过了什么?



您有想法如何解决问题吗?

谢谢

解决方案

您是否尝试了此帖中提供的解决方案: https ://stackoverflow.com/a/37565535/3108709 。我有和你一样的问题,这为我解决了它。


这是因为您应该始终将apply plugin子句放在谷歌服务的底部,因为它寻找已经添加的依赖关系。在您的应用程序级gradle中执行此操作:

依赖关系{
compile'c​​om.google.android.gms:play- services-ads:9.0.1'
}
//在底部添加
apply插件:'com.google.gms.google-services'



这隐藏在Firebase文档中,但即使您未使用Firebase也适用。



注意:更新Google Repository。



I get an error saying

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.

I tried looking at https://bintray.com/android/android-tools/com.google.gms.google-services/ and com.google.gms:google-services:3.0.0 seems to be the latest. This is my project gradle

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

And this is how my app gradle looks like

    apply plugin: 'com.android.application'


android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"
    defaultConfig {
        applicationId "sk.tipos.paradox02.citaj"
        minSdkVersion 11
        targetSdkVersion 23
        versionCode 27
        versionName '2.003'
    }


    buildTypes {
        release {
            minifyEnabled false
            multiDexEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          //  signingConfig signingConfigs.release
        }

        debug {
            debuggable true
            minifyEnabled false
            multiDexEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt')
//            signingConfig signingConfigs.release
        }
    }


    productFlavors {
    }

    lintOptions {

        checkReleaseBuilds false

    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.google.gms:google-services:3.0.0'
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.android.support:design:23.1.0'
    compile 'com.google.android.gms:play-services:10.2.0'
    compile 'com.google.android.gms:play-services-ads:10.2.0'
    compile 'com.google.android.gms:play-services-appindexing:9.8.0'
    compile 'com.google.android.gms:play-services-analytics:10.2.0'

    compile 'com.google.firebase:firebase-core:9.0.0'
    compile 'com.google.firebase:firebase-crash:10.0.1'
    compile 'com.google.firebase:firebase-ads:10.0.1'
    compile 'com.android.support:multidex:1.0.1'
}

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

If I change the play services to 9.0.0 everything compiles fine. What am I missing here?

Have you idea how resolve problem?

Thanks

解决方案

Have you tried the solution given in this post: https://stackoverflow.com/a/37565535/3108709 . I had the same issue as you had, this solved it for me.

That's because you should always put the "apply plugin" clause at the bottom for google-services, since it looks for the already-added dependencies. Do it like this in your app-level gradle:

dependencies { compile 'com.google.android.gms:play-services-ads:9.0.1' } // ADD THIS AT THE BOTTOM apply plugin: 'com.google.gms.google-services'

This is hidden in the Firebase documentation, but applies even if you don't use Firebase.

Note : Update Google Repository also.

这篇关于将google服务从9.0.0更新到10.0.1 Android studio 2.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆