无法编译play-services-places:15.0.1

时间:2018-07-23 07:01:24

标签: android google-play-services google-places-api

我无法包含'com.google.android.gms:play-services-places:15.0.1'项目。我收到以下错误

  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. `

注意:如果我删除 play-services-places:15.0.1 ,它可以正常运行。身份验证服务正常运行。

这就是我所拥有的。

项目级别gradle

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


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

应用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'

2 个答案:

答案 0 :(得分:1)

很抱歉回答我自己的问题。

解决方案是从 Christopher

的评论中禁用离线模式

转到 Android Studio>首选项>构建,执行,部署> Gradle ,然后取消选中离线工作

enter image description here

答案 1 :(得分:0)

您可以检查SDK管理器中是否安装了“ Google存储库”?另外,请注意2个单独的SDK安装(其中一个来自Android Studio,另一个可能需要单独下载)。

enter image description here