我试图在我的应用程序中添加谷歌登录,但这种依赖不起作用

时间:2018-06-14 02:40:37

标签: java android

app/build.gradle    
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.google.android.gms:play-services-auth:15.0.1.
<a href="openFile:D:/DeVEloPER/Android/InternshipProjects/Watchman/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debug/compileClasspath&#39;: Could not resolve com.google.android.gms:play-services-auth:15.0.1.">Show Details</a>    
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.google.android.gms:play-services-auth:15.0.1.
<a href="openFile:D:/DeVEloPER/Android/InternshipProjects/Watchman/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debugAndroidTest/compileClasspath&#39;: Could not resolve com.google.android.gms:play-services-auth:15.0.1.">Show Details</a> 
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-auth:15.0.1.
<a href="openFile:D:/DeVEloPER/Android/InternshipProjects/Watchman/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debugUnitTest/compileClasspath&#39;: Could not resolve com.google.android.gms:play-services-auth:15.0.1.">Show Details</a>    
Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.google.android.gms:play-services-auth:15.0.1.
<a href="openFile:D:/DeVEloPER/Android/InternshipProjects/Watchman/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@release/compileClasspath&#39;: Could not resolve com.google.android.gms:play-services-auth:15.0.1.">Show Details</a>  
Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-auth:15.0.1.
<a href="openFile:D:/DeVEloPER/Android/InternshipProjects/Watchman/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@releaseUnitTest/compileClasspath&#39;: Could not resolve com.google.android.gms:play-services-auth:15.0.1.">Show Details</a>  

1 个答案:

答案 0 :(得分:0)

使用最新版本

更新项目gradle文件
 classpath 'com.android.tools.build:gradle:3.1.0'
    classpath 'com.google.gms:google-services:3.0.0'

也放置

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

在你的应用程序底部依赖。