Puni
Puni

Reputation: 1294

Failed to compile play-services-places:15.0.1

Im not able to include 'com.google.android.gms:play-services-places:15.0.1' project. I'm getting the following error

  Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.google.android.gms:play-services-places:15.0.1. 

    Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.google.android.gms:play-services-places:15.0.1.

    Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-places:15.0.1.

    Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.google.android.gms:play-services-places:15.0.1.

     Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-places:15.0.1. `

Note: If I remove play-services-places:15.0.1 it works fine. The auth service works fine.

This is what I have.

Project level gradle

classpath 'com.google.gms:google-services:4.0.1'


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

app gradle

dependencies {


implementation 'com.google.android.gms:play-services-places:15.0.1' 
implementation 'com.google.android.gms:play-services-auth:15.0.1'

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

Upvotes: 0

Views: 538

Answers (2)

Puni
Puni

Reputation: 1294

Sorry for answering my own question.

The solution was to disable offline mode from the comment by Christopher

Go to Android Studio > Preferences > Build, Execution, Deployment > Gradle and turn uncheck Offline work

enter image description here

Upvotes: 1

Prokash Sarkar
Prokash Sarkar

Reputation: 11873

Can you check if you have "Google Repository" installed in SDK manager? Also, beware of 2 separate SDK installations (One coming from Android Studio and one you might have downloaded separately).

enter image description here

Upvotes: 0

Related Questions