Google的新地方信息库(实现“ com.google.android.libraries.places:1.0.0”)无法解析

时间:2019-02-01 17:43:10

标签: 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
}

3 个答案:

答案 0 :(得分:14)

依赖关系无效;应该是:

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

请参见migration guide

答案 1 :(得分:0)

这不是您的问题,而是Google的问题。您可能已经从此链接https://developers.google.com/places/android-sdk/start获得了依赖关系,对吗?他们在那里提供了这种依赖性:

dependencies {
    implementation 'com.google.android.libraries.places:1.0.0'
}

但是,相反,您必须单击此链接https://developers.google.com/places/android-sdk/client-migration,在这里您将获得正确的依赖关系。这是:

dependencies {
    implementation 'com.google.android.libraries.places:places:1.0.0'
}

答案 2 :(得分:-1)

我已使用此migration指南在我的项目中实施了该软件,并给出了逐步解决方案以在我们的项目中实现AutoCompletePlace。  link在这里给出。

您可以在项目中添加此依赖项。

dependencies {
  implementation 'com.google.android.libraries.places:places:1.0.0'
}

希望这对您有所帮助。谢谢.......