首页 > 解决方案 > com.android.support 库必须使用完全相同的版本规范 & [] Google Play 服务有问题

问题描述

我正在尝试使用来自 google placesApi 的自动填充和来自 google maps Api 的距离/地图。当我将两者都添加到我的依赖项(位置版本为 26.1.0)时,我遇到了一个兼容问题。但是,当我尝试通过为 27.1.1 实施 cardview 来修复它时,地图不再显示,并显示“我的应用程序在使用 Google Play 服务时遇到问题”。

我的依赖如下:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'

    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.android.gms:play-services-maps:10.0.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:design:27.1.1'

    // 1. So far, Google Maps work


    // 2. After adding the following code --> Compatibility issue (27.1.1 vs 26.1.0)
    //implementation 'com.google.android.libraries.places:places-compat:1.1.0'    


    // 3. After adding the following code upfront --> My app having trouble with Google Play services
    //implementation 'com.android.support:cardview-v7:27.1.1'

}


Could someone give me some insights on how I may fix this problem?
Thanks!

标签: javaandroid

解决方案


推荐阅读