android - Google 的新位置库(实现 'com.google.android.libraries.places:1.0.0')未解析

标签 android google-places-api

我正在尝试迁移到新的 Places SDK 客户端,但我被告知要在 documentation 中安装依赖项给我一个“无法解决”的错误。我确保删除旧的 SDK 和 places-compat 库,然后进行清理和重建。

这是我的依赖列表:

dependencies {
       implementation 'com.android.support:support-v4:28.0.0'
        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 fileTree(include: ['*.jar'], dir: 'libs')
        implementation 'com.android.support:appcompat-v7:28.0.0'
        implementation 'com.android.support:support-v13:28.0.0'
        implementation 'com.android.support:cardview-v7:28.0.0'
        implementation 'com.android.support:customtabs:28.0.0'
        implementation 'com.android.support:design:28.0.0'
        implementation 'com.android.support:support-media-compat:28.0.0'
        implementation 'com.android.support.constraint:constraint-layout:1.1.3'
        implementation 'com.android.support:recyclerview-v7:28.0.0'
        implementation 'com.android.support:multidex:1.0.3'
        implementation 'android.arch.paging:runtime:1.0.1'
        implementation 'com.google.code.gson:gson:2.8.5'
        implementation 'org.jetbrains:annotations:16.0.2'
        implementation 'com.google.android.gms:play-services-auth:16.0.1'
        implementation 'com.google.android.gms:play-services-ads:17.0.0'
        implementation 'com.google.android.libraries.places:1.0.0'
        implementation 'com.facebook.android:facebook-android-sdk:4.38.1'
        implementation 'com.google.firebase:firebase-core:16.0.4'
        implementation 'com.firebaseui:firebase-ui-auth:4.2.0'
        implementation 'com.google.firebase:firebase-firestore:18.0.0'
        implementation 'com.firebaseui:firebase-ui-firestore:4.1.0'
        implementation 'com.google.firebase:firebase-auth:16.1.0'
        implementation 'com.google.firebase:firebase-ads:17.0.0'
        implementation 'com.google.firebase:firebase-messaging:17.3.4'
        implementation('com.crashlytics.sdk.android:crashlytics:2.9.6@aar') {
            transitive = true
        }
    }

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

这是我的项目级 gradle 文件:

buildscript {

    repositories {
        google()
        jcenter()
        mavenCentral()
        maven{
            url 'https://maven.fabric.io/public'
        }
        maven{
            url "https://maven.google.com"
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'
        classpath'com.google.gms:google-services:4.2.0'
        classpath 'io.fabric.tools:gradle:1.26.1'


    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.google.com/'
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

最佳答案

那个依赖是无效的;那应该是:

dependencies {
    implementation "com.google.android.libraries.places:places:1.1.0"
}

参见 migration guide .

关于android - Google 的新位置库(实现 'com.google.android.libraries.places:1.0.0')未解析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54484585/

相关文章:

javascript - 如何在 react-native 上为 android 和 ios 使用不同的样式?

android - 非棘手的观点

android - 具有无限制 key 的 PLACES_API_ACCESS_NOT_CONFIGURED

google-maps - 在iOS中实现Google Places自动完成API

java - 如何将两个改造请求中的数据传递到单个 recyclerview 适配器

javascript - 谷歌放置自动完成小部件为每个请求生成一个新的 session key

android - 如何远程唤醒手机?

android - 单击 webview 中的选择框时应用程序崩溃

android - 抽屉导航菜单滚动效果

java - 选择地点或尝试返回时,Android 地点选择器显示空白屏幕