java - Android Studio 中缺少存储库

标签 java android android-studio

我正在 android studio 中开发一个项目,需要使用 google play 服务。我知道我需要安装 SDK,但如照片所示,系统会提示我下载必须使用的存储库的链接。不幸的是,这个链接不起作用,我无法下载存储库,因此我的 gradle 将不会同步。我该怎么办?

My code

最佳答案

我感觉您使用了错误的 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/

相关文章:

java - 如何通过ASM中的核心api获取maxLocals?

java - catalina.bat 开始不工作

java - <T 扩展是什么意思?

java - Android Studio 在使用 orElseThrow 方法时需要捕获 Throwable

java - ListView 项目未在 BaseExpandableListAdapter 中删除

java - Top Trumps 卡的类结构

java - 结果集移动到第一个记录

java - 错误 :Execution failed for task ':app:processDebugResources' . > java.io.IOException:无法在 android studio 中删除文件夹 ""

java - 如何从其他 Activity android调用函数

android - Android Gradle插件3.0.0-beta2-ZLIB输入流意外结束