Gradle could not find dependency com.google.android.gms:play-services

could not find com/google/android/gms/play-services-ads identifier 12.0 1
failed to resolve: com google android gms play-services
com google android gms play-services-iid
com google android gms play-services-maps 11.8 0
com google android gms play-services-ads:18.2 0
com google android gms location dependency
implementation 'com google android gms play-services-ads:17.2 0
com google android gms drive drivefile gradle

I have a problem since I upgraded my Android Studio to 3.0.0 : I cannot find com.google.android.gms:play-services anymore!

After adding this dependency, when I try to sync my project I get this message :

Failed to resolve: com.google.android.gms:play-services-games:11.4.2

I can click on "Install repository and sync project" but when I do, I get this message :

Could not find dependency "com.google.android.gms:play-services-games:11.4.2"

I tried to search, but the only solutions I found was to install Google repository, and add jcenter() to the repositories in my build.gradle file But I already did that!

Any idea?

Here is my build.gradle file :

buildscript {


    repositories {
        mavenLocal()
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
        classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.1'


    }
}

allprojects {
    apply plugin: "eclipse"
    apply plugin: "idea"

    version = '1.0'
    ext {
        appName = "Glowee"
        gdxVersion = '1.9.7'
        roboVMVersion = '2.3.1'
        box2DLightsVersion = '1.4'
        ashleyVersion = '1.7.0'
        aiVersion = '1.8.0'
    }

    repositories {
        mavenLocal()
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        maven { url "https://oss.sonatype.org/content/repositories/releases/" }
    }
}

project(":desktop") {
    apply plugin: "java"


    dependencies {
        compile project(":core")
        compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
        compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"

    }
}

project(":android") {
    apply plugin: "android"

    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-arm64-v8a"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
        compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"

        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64"

        compile "com.google.android.gms:play-services-games:11.4.2"
        compile "com.google.android.gms:play-services-ads:11.4.2"
        compile "com.google.android.gms:play-services-plus:11.4.2"

    }
}

project(":ios") {
    apply plugin: "java"
    apply plugin: "robovm"


    dependencies {
        compile project(":core")
        compile "com.mobidevelop.robovm:robovm-rt:$roboVMVersion"
        compile "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
        compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"

        compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios"

    }
}

project(":core") {
    apply plugin: "java"


    dependencies {
        compile "com.badlogicgames.gdx:gdx:$gdxVersion"

        compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"

    }
}

tasks.eclipse.doLast {
    delete ".project"
}

i fixed the issue by adding google() repository in build.gradle project module

Could not find com.google.android.gms:play-services:3.1.59 3.2.25 , If not, you also have to install the "Google Repository" in your SDK Manager. Also be aware that compile 'com.google.android.gms:play-services:+' You should add some dependencies in build.gradle, just looks like this add the classpath in the build.gradle at your project level not the one in module level. dependencies { classpath 'com.android.tools.build:gradle:2.3.1' classpath 'com.google.gms:google-services:3.+' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }

I had the same issue, i fix it by adding google() repository in build.gradle project module

Could not find com.google.android.gms:play-services-gcm · Issue , Could not find com.google.android.gms:play-services-gcm #13. Closed Could not resolve all dependencies for configuration ':app:_debugApkCopy'. Could not find I already include maven.google.com in root gradle file. Could not find com.google.android.gms:play-services-location:11.6.0. gradle:3.1.4' // NOTE: Do not place your application dependencies here; they belong // in the

I tried with 'google()' but it didnt work, reading some suggestions of AndroidStudio I found out that to solve this I had to modify manually the build.gradle file upgrading the compileSdkVersion, minSdkVersion, etc ... I guess that the problem came out because I was using something that wasnt compatible with the minSdkVersion that I had.

Could not find com.google.android.gms:play-services-location:11.6 , Could not find com.google.android.gms:play-services-location:11.6.0 #367 dependencies { classpath 'com.android.tools.build:gradle:3.1.4'  Add classpath com.google.gms:google-services:3.0.0 dependencies at project level build.gradle. Refer the sample block from project level build.gradle. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.3.3' classpath 'com.google.gms:google-services:3.0.0' // NOTE: Do not place your application dependencies here; they belong // in the individual

Failed to resolve: com.google.android.gms:play-services-vision , Here is a part of myandroid/build.gradle builds type org.gradle.api.internal.​artifacts.dsl.dependencies.DefaultDependencyHandler Could not find com.​google.android.gms:play-services-vision:16.1.0 #1350. Open. Make sure you've used the SDK manager to install the "Android Support Repository." That is a locally installed maven repo that contains the Google Play services, the support libraries and some of the dependencies thereof.

Release Notes | Google APIs for Android, com.google.android.gms:play-services-recaptcha:16.0.0 For more information, see the Firebase Android SDK Release Notes. it is effectively non-null) so that this change does not break Kotlin code that passes in an Activity? The latest update to the OSS licenses Gradle plugin includes fixes for the following issues:. Open the build.gradle file inside your application module directory. Note: Android Studio projects contain a top-level build.gradle file and a build.gradle file for each module. Be sure to edit the file for your application module. See Building Your Project with Gradle for more information about Gradle. Add a new build rule under dependencies

Error Admob : Could not find com.google.android.gms:play-services , I'm also using latest Android SDK 28, not sure about play service version extension-admob/1,6,4/dependencies/admobex/build.gradle into : The above Gradle configuration defines a buildscript property called play_version with the version of the Google Play services and Firebase libraries and uses that to declare dependencies. This pattern had been helpful to keep all the dependency versions together, as previously required.

Comments
  • Have you added the google() repository? developer.android.com/studio/build/…
  • I just did! I added it under the jcenter() repository, but I still get the same error
  • See this: developer.android.com/studio/build/…
  • stackoverflow.com/questions/30811608/…
  • Ok I fixed it! I was adding the google() repository in the buildscript scope, I deplaced it to the allprojects scope and now it works, thank you!
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
  • I attached the screenshot of my Project Build Gradle . That's all . And he needs to do is just add "google()" this in the repositories { } and that is what the screenshot tells(or how I implemented) It is a link to the imgur that's all @Saranjith
  • I have this problem, and I have google() in my repositories.
  • @SalmanSeifian put google() in the first line, before jcenter()