Could not find com.google.android.gms:play-services:3.1.59 3.2.25 4.0.30 4.1.32 4.2.40 4.2.42 4.3.23 4.4.52 5.0.77 5.0.89 5.2.08 6.1.11 6.1.71 6.5.87

AndroidGradleGoogle Play-Services

Android Problem Overview


referencing the play-services via gradle stopped working for me - boiled it down - even the sample I used as a reference in the first place stopped working: https://plus.google.com/+AndroidDevelopers/posts/4Yhpn6p9icf

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':auth'.
> Failed to notify project evaluation listener.
   > Could not resolve all dependencies for configuration ':auth:compile'.
      > Could not find com.google.android.gms:play-services:3.1.36.
        Required by:
            gpsdemos:auth:unspecified

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3.577 secs

I fear that just the version increased but that raises 2 questions: #1) what is the new one? #2) why is the old version gone?

Android Solutions


Solution 1 - Android

Check if you also installed the "Google Repository". If not, you also have to install the "Google Repository" in your SDK Manager.

Also be aware that there might be 2 SDK installations - one coming from AndroidStudio and one you might have installed. Better consolidate this to one installation - this is a common pitfall - that you have it installed in one installation but it fails when you build with the other installation.

Example of how to access SDK Manager for Google Repository

Solution 2 - Android

Just install Google Repository form your sdk manager and than restart Android Studio.

Solution 3 - Android

In addition to installing the repository and the SDK packages one should be aware that the version number changes periodically. A simple solution at this point is to replace the specific version number with a plus (+) symbol.

compile 'com.google.android.gms:play-services:+'

Google instructions indicate that one should be sure to upgrade the version numbers, however adding the plus deals with the changes in versioning. Also note that when building in Android Studio a message will appear in the status line when a new version is available.

One can view the available versions of play services by drilling down on the correct repository path:

play-services repository path

References

This site also has instructions for Eclipse, and other IDE's.

ADS-Setup

Solution 4 - Android

I've been strugglin with this problem for hours till found this post. Just like @ligi said, some people have two SDK folders (Android Studio, which is bundled and Eclipse). The problem is that it doesn't matter if you downloaded the Google Play Services library on both SDK folders, your ANDROID_HOME enviroment variable must be pointing to the SDK folder used by the Android Studio.

SDK Folder A  (Used on Eclipse)
SDK Folder B  (Used on AS)

ANDROID_HOME=<path to SDK Folder B>

After change the path of this variable the error was gone.

Solution 5 - Android

I had the same problem because I had:

compile 'com.google.android.gms:play-services:5.2.8'

and I solved changing the version numbers for a '+'. so the lines has to be:

compile 'com.google.android.gms:play-services:+'

Solution 6 - Android

Adding this as a second reference because I had a similar problem..
I had to explicitly add '.aar' as a registered file type under the 'Archives' category in AS settings.

Solution 7 - Android

If you already have Google Repository installed, make sure it's updated. I had to update my Google Repository and services. This was after I updated Android Studio.

Solution 8 - Android

I added a new environment variable ANDROID_HOME and pointed it to the SDK (C:\Program Files (x86)\Android\android-studio\sdk) that is inside the installation directory of Android Studio. (Environment variables are a part of windows; you access them through the advanced computer properties...google it for more info)

Solution 9 - Android

I too had the same problem and resolved.

As per the above-mentioned solutions by others, I tried all the things and it does not solve my problem.

Even if you have two SDK locations, no need to worry about it and check whether your android home is set to Android studio SDK (If you have the Android repository and everything in that SDK location).

Solution:

  • Go to Your project structure
  • Select your modules
  • Click the dependance tap on the right side
  • Add library dependency
  • "com.google.android.gms:play-service:+"

I hope it will solve your problem.

Solution 10 - Android

I have the same question.

You should add some dependencies in build.gradle, just looks like this

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':libcocos2dx')
    compile 'com.google.firebase:firebase-ads:11.6.0'
// the key point line
    compile 'com.google.android.gms:play-services-auth:11.6.0'
}

Solution 11 - Android

By mistake I added the compile com.google.android.gms:play-services:5.+ in dependencies in build script block. You should add it in the second dependency block. make changes->synch project with gradle.

Solution 12 - Android

Personally this post helped me to solve this issue by moving the google() to the top of the repositories.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionligiView Question on Stackoverflow
Solution 1 - AndroidligiView Answer on Stackoverflow
Solution 2 - AndroidKhayam GondalView Answer on Stackoverflow
Solution 3 - AndroidTommie C.View Answer on Stackoverflow
Solution 4 - AndroidAmaroView Answer on Stackoverflow
Solution 5 - AndroidShudyView Answer on Stackoverflow
Solution 6 - AndroidShirkrinView Answer on Stackoverflow
Solution 7 - AndroidBlackHatSamuraiView Answer on Stackoverflow
Solution 8 - Androiduser54636View Answer on Stackoverflow
Solution 9 - AndroidSelvaganesan SaminathanView Answer on Stackoverflow
Solution 10 - AndroidReadyShowView Answer on Stackoverflow
Solution 11 - Androiduser1691916View Answer on Stackoverflow
Solution 12 - AndroidYairoproView Answer on Stackoverflow