Reputation: 5597
I'm trying to update an old project that uses GMS libraries. However, Gradle sync fails to refresh the project, giving the error mentioned in the title.
This is what the build.gradle looks like:
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"
}
}
And the error is:
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
I've installed and updated all the required stuff in the SDK manager:
It should be noted that this project was originally an Eclipse project which I imported to Android Studio just now.
EDIT: It seems that Gradle doesn't look the correct directory for GMS. It's installed in the SDK path, though. It seems that the problem here is very similar to this unsolved question.
Upvotes: 15
Views: 36623
Reputation: 3040
Firstly update the Android SDK tools, Android SDK Build Tools, Android SDK platform-tools.
Then update Google Play Services and Google Repository from SDK Manager. They are present in Extras section in SDK manager.
This worked for me.
Upvotes: 2
Reputation: 363
You should use 6.5.87 instead of 7.0.0.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services-maps:6.5.87'
compile 'com.google.android.gms:play-services-drive:6.5.87'
}
Upvotes: 1
Reputation: 697
You need just to add this line to your dependencies and rebuild your project: compile 'com.google.android.gms:play-services:6.5.87'
Upvotes: 0
Reputation: 932
To use Google Play Services version 7.0.0, you will need to update the Google Play Services and the Google Repository to Rev. 23 & 16 respectively in the Extras section within Android SDK Manager.
To open the Android SDK Manager in Android Studio, go to Tools -> Android -> SDK Manager.
Edit: You will also have to update your SDK Tools to Rev. 24.1.2, SDK Platform Tools to Rev. 22 and optionally the SDK Build Tools to Rev. 22.0.1 from the Tools section in the SDK Manager.
Upvotes: 17
Reputation: 1654
It turns out the documentation might be more ahead than what is officially available.
compile 'com.google.android.gms:play-services:6.5.87'
Seems to work fine only because I did the following steps:
Open Module Settings(F12) -> Dependencies Tab -> "+" sign -> 1) Library Dependency -> com.google.android.gms:play-services:6.5.87
Upvotes: 18