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

I have an Android project, and when you run the command ./gradlew dependencies, I get the following error, and I cannot figure out how to use Google Play 8.4.0. (8.3.0 works)

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not find com.google.android.gms:play-services:8.4.0.
     Searched in the following locations:
         https://jcenter.bintray.com/com/google/android/gms/play-services/8.4.0/play-services-8.4.0.pom
         https://jcenter.bintray.com/com/google/android/gms/play-services/8.4.0/play-services-8.4.0.jar
         https://maven.fabric.io/public/com/google/android/gms/play-services/8.4.0/play-services-8.4.0.pom
         https://maven.fabric.io/public/com/google/android/gms/play-services/8.4.0/play-services-8.4.0.jar
         https://zendesk.artifactoryonline.com/zendesk/repo/com/google/android/gms/play-services/8.4.0/play-services-8.4.0.pom
         https://zendesk.artifactoryonline.com/zendesk/repo/com/google/android/gms/play-services/8.4.0/play-services-8.4.0.jar
         https://repo1.maven.org/maven2/com/google/android/gms/play-services/8.4.0/play-services-8.4.0.pom
         https://repo1.maven.org/maven2/com/google/android/gms/play-services/8.4.0/play-services-8.4.0.jar
         file:/usr/local/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services/8.4.0/play-services-8.4.0.pom
         file:/usr/local/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services/8.4.0/play-services-8.4.0.jar
         file:/usr/local/android-sdk-linux/extras/google/m2repository/com/google/android/gms/play-services/8.4.0/play-services-8.4.0.pom
         file:/usr/local/android-sdk-linux/extras/google/m2repository/com/google/android/gms/play-services/8.4.0/play-services-8.4.0.jar

This is what the gradle application looks like.

  dependencies {
      ....
      compile 'com.google.android.gms:play-services:8.4.0'
      ....
  }

I tried putting the following into a gradle project file, but didn't help.

    dependencies {
      classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
      classpath 'com.google.gms:google-services:2.0.0-alpha3'
    }

Can someone help me debug further?

+4
source share
5 answers

There was a problem setting up the ': app' project.

Failed to resolve all dependencies for configuration: app: _debugCompile. Could not find com.google.android.gms: play-services: 8.4.0.

Post your shared build.gradle

  • Use the latest build tools
  • classpath 'com.android.tools.build:gradle:2.0.0-alpha3'

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId ""
        minSdkVersion 17
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }

8.4.0

+8

, Google Google Repository. Google Repository Android Support Repository SDK gradle . gradle.build :

buildscript {
    repositories { jcenter() }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'
    }
}
apply plugin: 'com.android.application'
android {
  repositories { jcenter() }
  compileSdkVersion 24
  buildToolsVersion '24.0.1'
  dependencies {
    compile 'com.google.android.gms:play-services:9.2.1'
  }
}
+5

. Android SDK:

  • Android
  • Google Play
  • Google

If you use the SDK command line tools for Android sdkmanager , you can run the following command to install related packages:

sdkmanager "extras;android;m2repository"
sdkmanager "extras;google;m2repository"
sdkmanager "extras;google;google_play_services"
+2
source

you need

buildToolsVersion "23.0.2"

you have boot in sdk manager

and change this value to build.gradle

and I use this on the build.gradle project side

classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.google.gms:google-services:1.5.0-beta2'
+1
source

also add this line to your gradle application level

apply plugin: 'com.google.gms.google-services'
dependencies {
      ....
      compile 'com.google.android.gms:play-services:8.4.0'
      ....
  }
0
source

Source: https://habr.com/ru/post/1626823/


All Articles