man*_*eak 15 android gradle google-play-services android-studio
我正在尝试更新使用GMS库的旧项目.但是,Gradle同步无法刷新项目,从而给出标题中提到的错误.
这就是build.gradle的样子:
project(":android") {
apply plugin: "android"
apply plugin: 'com.android.application'
configurations { natives }
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
compile "com.google.android.gms:play-services:7.0.0"
}
}
Run Code Online (Sandbox Code Playgroud)
错误是:
Error:Could not find com.google.android.gms:play-services:7.0.0.
Searched in the following locations:
file:/C:/Users/Harri/.m2/repository/com/google/android/gms/play-services/7.0.0/play-services-7.0.0.pom
file:/C:/Users/Harri/.m2/repository/com/google/android/gms/play-services/7.0.0/play-services-7.0.0.jar
https://repo1.maven.org/maven2/com/google/android/gms/play-services/7.0.0/play-services-7.0.0.pom
https://repo1.maven.org/maven2/com/google/android/gms/play-services/7.0.0/play-services-7.0.0.jar
https://oss.sonatype.org/content/repositories/snapshots/com/google/android/gms/play-services/7.0.0/play-services-7.0.0.pom
https://oss.sonatype.org/content/repositories/snapshots/com/google/android/gms/play-services/7.0.0/play-services-7.0.0.jar
https://oss.sonatype.org/content/repositories/releases/com/google/android/gms/play-services/7.0.0/play-services-7.0.0.pom
https://oss.sonatype.org/content/repositories/releases/com/google/android/gms/play-services/7.0.0/play-services-7.0.0.jar
Required by:
CarGame-refresh:android:1.2
Run Code Online (Sandbox Code Playgroud)
我已经在SDK管理器中安装并更新了所有必需的东西:

应该注意的是,这个项目最初是一个Eclipse项目,我刚刚导入Android Studio.
编辑:似乎Gradle看起来不是GMS的正确目录.但它安装在SDK路径中.看来这里的问题与这个未解决的问题非常相似.
Mar*_*asa 17
事实证明,文档可能比官方提供的文档更先进.
compile 'com.google.android.gms:play-services:6.5.87'
Run Code Online (Sandbox Code Playgroud)
似乎只是因为我做了以下步骤才能正常工作:
打开模块设置(F12) - >依赖项选项卡 - >"+"符号 - > 1)库依赖项 - > com.google.android.gms:play-services:6.5.87
Has*_*aan 16
要使用Google Play Services 7.0.0版,您需要在Android SDK Manager的Extras部分分别将Google Play服务和Google Repository更新为Rev. 23和16.
要在Android Studio中打开Android SDK Manager,请转到工具 - > Android - > SDK Manager.
编辑:您还必须从SDK Manager的"工具"部分将SDK工具更新到Rev. 24.1.2,将SDK平台工具更新到Rev. 22,并可选择将SDK Build Tools更新到Rev. 22.0.1.
| 归档时间: |
|
| 查看次数: |
35412 次 |
| 最近记录: |