摇篮无法找到谷歌播放依赖
我尝试修复的依赖在我的Android项目谷歌播放服务。它已经工作,但现在却是坏了。我想,这件事发生在Android工作室β-和发行版本之间。
I try to repair the dependency to google play services in my android project. It already worked but now it is broken. I think this happened in between the Android Studio beta- and release-version.
这是在build.gradle文件的依赖性:
This is the dependency in the build.gradle file:
dependencies {
compile 'com.google.android.gms:play-services:6.5.87'
}
Android的工作室能够自动完成的版本字符串:87年5月6日因此,我认为它知道如何解决的依赖。但事实并非如此。这就是我TREID:
Android Studio was able to autocomplete the version string: '6.5.87' So I thought it knows how to solve the dependency. But it does not.. This is what I treid:
- reinstaled机器人工作室(1.0.1)和Android SDK
- 在使用了多种播放服务版本(包括试图用'+')
- 在试图gradlew干净的项目
- 在安装几乎所有的从Android SDK管理器。 (包括谷歌信息库和Android的支持库)
- 设置所有环境变量,以正确的路径
但我仍然得到这个错误,如果我尝试做一个摇篮工程同步:
But I still get this error if I try to do a gradle project sync:
错误:找不到com.google.android.gms:播放服务:87年6月5日。 搜索在以下位置: file:/C:/Users/MyName/.m2/repository/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.pom file:/C:/Users/MaName/.m2/repository/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.jar https://repo1.maven.org/maven2/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.pom https://repo1.maven.org/maven2/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.jar https://oss.sonatype.org/content/repositories/snapshots/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.pom https://oss.sonatype.org/content/repositories/snapshots/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.jar https://oss.sonatype.org/content/repositories/releases/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.pom https://oss.sonatype.org/content/repositories/releases/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.jar 要求: code:安卓1.0
Error:Could not find com.google.android.gms:play-services:6.5.87. Searched in the following locations: file:/C:/Users/MyName/.m2/repository/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.pom file:/C:/Users/MaName/.m2/repository/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.jar https://repo1.maven.org/maven2/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.pom https://repo1.maven.org/maven2/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.jar https://oss.sonatype.org/content/repositories/snapshots/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.pom https://oss.sonatype.org/content/repositories/snapshots/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.jar https://oss.sonatype.org/content/repositories/releases/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.pom https://oss.sonatype.org/content/repositories/releases/com/google/android/gms/play-services/6.5.87/play-services-6.5.87.jar Required by: code:android:1.0
更新:
摇篮的搜索中的文件:/ C:/Users/MyName/.m2/repository/,但它应该使用 文件:/ C:/用户/ MYNAME /应用程序数据\本地\机器人\ SDK \演员\谷歌\ m2repository..我不知道为什么这是错的,如何解决它。
Gradle is searching in "file:/C:/Users/MyName/.m2/repository/" but it should use "file:/C:/Users/MyName/AppData\Local\Android\sdk\extras\google\m2repository" .. I dont know why this is wrong and how to fix it..
更新2
我固定它使用此解决方法:
I fixed it using this workaround:
repositories {
def androidHome = System.getenv("ANDROID_HOME")
maven { url "$androidHome/extras/android/m2repository/" }
maven { url "$androidHome/extras/google/m2repository/"}
}
但我不喜欢它。有谁知道什么是错我的摇篮?
But I am not happy with it. Does anybody know whats wrong with my gradle?
在Android SDK中管理器下载谷歌库
In Android SDK Manager download the "Google Repository"