Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find com.google.android.gms:play-services:7.0.0

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:

enter image description here

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.

like image 867
manabreak Avatar asked Mar 22 '15 07:03

manabreak


People also ask

What is com Google GMS Google-services?

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.

Where to put google-services JSON in Android?

The google-services. json file is generally placed in the app/ directory (at the root of the Android Studio app module).

In which configuration file do we add the required dependencies?

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.


1 Answers

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

like image 124
Mark Lapasa Avatar answered Oct 15 '22 10:10

Mark Lapasa