【发布时间】:2015-05-09 02:49:52
【问题描述】:
我正在尝试让 AdMob 运行。但由于某些奇怪的原因,我无法让 Android Studio 接受已安装 Google Repository。 问题是,它安装在 SDK 管理器中。现在重新安装了多次。项目结构 SDK 路径与 Android SDK Manager 中的相同。
当我将鼠标悬停在 build.gradle 中的 compile 'com.google.android.gms:play-services:6.+' 行上时,我会看到以下工具提示:
"Dependency on Play Services, but the SDK installation does not have the "Extras > Google Repository" installed. Open the SDK manager and install it"
当我尝试编译时,这个错误:
Error:Failed to resolve: com.google.android.gms:play-services:6.+
伴随该错误而来的是一个安装存储库的链接,我现在多次使用该链接。 Android Studio 不在乎。帮助。
edit:当我使用一个新的空项目时,它可以工作,并且 Android Studio 会找到存储库。不知道这里发生了什么。
【问题讨论】:
-
尝试打开和关闭 Studio。出于某种原因,这有时对我有用。
-
谢谢,但已经尝试过了。没有帮助。
-
得到完全相同的错误,你能解决这个问题吗?
-
一个迟到的答案:我放弃了,只是将旧项目的内容复制到新项目中。
-
IDEA 2016.1.3 中的相同问题。 (不尝试使用 admob,但它拒绝接受已安装 Google Repository。)
标签: android android-studio android-gradle-plugin android-sdk-manager