无法解析com.google.firebase:firebase-core:10.2.6

时间:2017-06-08 18:31:50

标签: android firebase gradle

我正在尝试为我的应用添加Firebase支持

我添加了classpath 'com.google.gms:google-services:3.1.0' 到项目级gradle文件并添加

    compile 'com.google.firebase:firebase-auth:10.2.6'

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

当我同步时我得到了 enter image description here

当我尝试清理项目时,我得到了

    Error:A problem occurred configuring project ':app'.
  

无法解析配置':app:_debugCompile'的所有依赖项。   找不到com.google.firebase:firebase-auth:10.2.6。        在以下位置搜索:            file:/ C:/ Program Files / Android / Android Studio / gradle / m2repository / com / google / firebase / firebase-auth / 10.2.6 / firebase-auth-10.2.6.pom            file:/ C:/ Program Files / Android / Android Studio / gradle / m2repository / com / google / firebase / firebase-auth / 10.2.6 / firebase-auth-10.2.6.jar            https://jcenter.bintray.com/com/google/firebase/firebase-auth/10.2.6/firebase-auth-10.2.6.pom            https://jcenter.bintray.com/com/google/firebase/firebase-auth/10.2.6/firebase-auth-10.2.6.jar            文件:/ C:/Users/Adi/sdk/extras/android/m2repository/com/google/firebase/firebase-auth/10.2.6/firebase-auth-10.2.6.pom            文件:/ C:/Users/Adi/sdk/extras/android/m2repository/com/google/firebase/firebase-auth/10.2.6/firebase-auth-10.2.6.jar            文件:/ C:/Users/Adi/sdk/extras/google/m2repository/com/google/firebase/firebase-auth/10.2.6/firebase-auth-10.2.6.pom            文件:/ C:/Users/Adi/sdk/extras/google/m2repository/com/google/firebase/firebase-auth/10.2.6/firebase-auth-10.2.6.jar   找不到com.google.firebase:firebase-core:10.2.6。        在以下位置搜索:            file:/ C:/ Program Files / Android / Android Studio / gradle / m2repository / com / google / firebase / firebase-core / 10.2.6 / firebase-core-10.2.6.pom            file:/ C:/ Program Files / Android / Android Studio / gradle / m2repository / com / google / firebase / firebase-core / 10.2.6 / firebase-core-10.2.6.jar            https://jcenter.bintray.com/com/google/firebase/firebase-core/10.2.6/firebase-core-10.2.6.pom            https://jcenter.bintray.com/com/google/firebase/firebase-core/10.2.6/firebase-core-10.2.6.jar            文件:/ C:/Users/Adi/sdk/extras/android/m2repository/com/google/firebase/firebase-core/10.2.6/firebase-core-10.2.6.pom            文件:/ C:/Users/Adi/sdk/extras/android/m2repository/com/google/firebase/firebase-core/10.2.6/firebase-core-10.2.6.jar            文件:/ C:/Users/Adi/sdk/extras/google/m2repository/com/google/firebase/firebase-core/10.2.6/firebase-core-10.2.6.pom            文件:/ C:/Users/Adi/sdk/extras/google/m2repository/com/google/firebase/firebase-core/10.2.6/firebase-core-10.2.6.jar

     

找不到com.google.firebase:firebase-auth:10.2.6。        在以下位置搜索:            file:/ C:/ Program Files / Android / Android Studio / gradle / m2repository / com / google / firebase / firebase-auth / 10.2.6 / firebase-auth-10.2.6.pom            file:/ C:/ Program Files / Android / Android Studio / gradle / m2repository / com / google / firebase / firebase-auth / 10.2.6 / firebase-auth-10.2.6.jar            https://jcenter.bintray.com/com/google/firebase/firebase-auth/10.2.6/firebase-auth-10.2.6.pom            https://jcenter.bintray.com/com/google/firebase/firebase-auth/10.2.6/firebase-auth-10.2.6.jar            文件:/ C:/Users/Adi/sdk/extras/android/m2repository/com/google/firebase/firebase-auth/10.2.6/firebase-auth-10.2.6.pom            文件:/ C:/Users/Adi/sdk/extras/android/m2repository/com/google/firebase/firebase-auth/10.2.6/firebase-auth-10.2.6.jar            文件:/ C:/Users/Adi/sdk/extras/google/m2repository/com/google/firebase/firebase-auth/10.2.6/firebase-auth-10.2.6.pom            文件:/ C:/Users/Adi/sdk/extras/google/m2repository/com/google/firebase/firebase-auth/10.2.6/firebase-auth-10.2.6.jar

我已将Google Play服务更新到最新版本,但仍然无效。 我尝试了无效缓存&重启..

我该如何解决这个问题? 谢谢你的帮助。

2 个答案:

答案 0 :(得分:3)

在Android Studio中,“Google Play服务”开发人员工具组件版本40可让您访问Firebase和Play依赖项版本10.2.6。此时,现在还有版本41可以使11.0.0版的依赖项可用。

check your versions再试一次。

enter image description here

答案 1 :(得分:2)

我遇到了同样的问题,在更新了以下问题后,我的问题得到了解决:

  • Google Repository(修订版:53)
  • Android SDK平台工具(修订版:26.0.0)