我正在 android studio 中开发一个项目,需要使用 google play 服务。我知道我需要安装 SDK,但如照片所示,系统会提示我下载必须使用的存储库的链接。不幸的是,这个链接不起作用,我无法下载存储库,因此我的 gradle 将不会同步。我该怎么办?
最佳答案
我感觉您使用了错误的 API - 对于应用程序索引,您应该使用 Firebase App indexing .
因此,根据文档,你的 gradle 文件应该看起来像这样:
apply plugin: 'com.android.application'
android {
// ...
}
dependencies {
// ...
compile 'com.google.firebase:firebase-core:10.2.0'
// Getting a "Could not find" error? Make sure you have
// the latest Google Repository in the Android SDK manager
}
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
关于java - Android Studio 中缺少存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42541989/