Nestor
Nestor

Reputation: 8384

Google Play services failed to compile with Gradle

I tried to compile a library with Gradle with its gradlew.bat file but it keeps failing. It shows the following message:

FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring project ':library'.

    Could not resolve all dependencies for configuration ':library:_debugCompile'.

    Could not find com.google.android.gms:play-services:3.1.36. Required by: com.google.maps.android:library:0.3-SNAPSHOT

I already modified the gradle file to point it to the right direction:

List myDependencies = ["com.google.android.gms:play-services:3.1.36",
        fileTree (dir: 'c://Program Files/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services/3.1.36/', includes: ['*.jar'])]

dependencies {
    compile myDependencies
}

I have installed both Google Repository and Google Support Repository.

I use IntelliJ IDEA.

What else should I try?

Upvotes: 2

Views: 3082

Answers (1)

Nestor
Nestor

Reputation: 8384

I copied the google-play-services.jar file to my project and changed the build.gradle file to this:

dependencies {
   compile files('google-play-services.jar')
}

and it works okay now.

Upvotes: 2

Related Questions