Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google's new Places Library ( implementation 'com.google.android.libraries.places:1.0.0') not resolving

I am attempting to migrate to the new Places SDK client, but the dependency I'm told to install in the documentation is giving me a "failed to resolve" error. I made sure to remove the old SDK and the places-compat library, followed by cleaning and rebuilding.

Here is my list of dependencies:

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'

and here is my project level gradle file:

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
}
like image 371
andrewedgar Avatar asked Feb 01 '19 17:02

andrewedgar


2 Answers

that dependency is invalid; that should be:

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

see the migration guide.

like image 175
Martin Zeitler Avatar answered Nov 12 '22 15:11

Martin Zeitler


This is not an issue from your side, but from Google's. You might have got the dependency from this link https://developers.google.com/places/android-sdk/start right? They have provided this dependency there:

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

But instead you have to follow this link https://developers.google.com/places/android-sdk/client-migration, where you will get the correct dependency. which is :

dependencies {
    implementation 'com.google.android.libraries.places:places:1.0.0'
}
like image 44
Febin Mathew Avatar answered Nov 12 '22 17:11

Febin Mathew