【问题标题】:Android Studio Version Conflict/google mapsAndroid Studio 版本冲突/谷歌地图
【发布时间】:2017-12-18 20:59:39
【问题描述】:

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

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

我在尝试在我的项目中实施谷歌地图时不断收到此错误,有什么解决方法的想法吗?

以下是目前为止的代码...

dependencies {

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:design:26.1.0'

    implementation 'com.google.android.gms:play-services-maps:11.6.2'
    compile 'com.google.android.gms:play-services-auth:9.0.0'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

}

【问题讨论】:

    标签: android android-gradle-plugin


    【解决方案1】:

    这两个依赖:

    implementation 'com.google.android.gms:play-services-maps:11.6.2'
    compile 'com.google.android.gms:play-services-auth:9.0.0'
    

    必须是相同的版本。所以这会起作用:

    implementation 'com.google.android.gms:play-services-maps:11.6.2'
    implementation 'com.google.android.gms:play-services-auth:11.6.2'//using implementation instead of compile. compile is deprecated
    

    请注意,这适用于所有播放服务依赖项。还有其他依赖项(尽管您没有使用它们中的任何一个)。无论您安装了哪些播放服务组件,它们都必须具有相同的版本

    您设置的实际版本取决于您,但它们都必须匹配。他们都可以是9.0.0

    【讨论】:

    • 确保您使用的是随 SDK 一起安装的版本
    【解决方案2】:

    尝试将两个 Google 依赖项都设置为 11.6.0(如果可用,则设置为 11.6.2):

    implementation 'com.google.android.gms:play-services-maps:11.6.0'
    implementation 'com.google.android.gms:play-services-auth:11.6.0'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-07-26
      • 2018-10-20
      • 2017-08-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-08
      相关资源
      最近更新 更多