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.
Google's most popular apps, all in one place Google Mobile Services (GMS) is a collection of Google applications and APIs that help support functionality across devices.
The google-services. json file is generally placed in the app/ directory (at the root of the Android Studio app module).
To add a dependency to your project, specify a dependency configuration such as implementation in the dependencies block of your module's build.gradle file.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With