[android] 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

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?

This question is related to android gradle google-play-services

The answer is


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)


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'
}

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.


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.


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.


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


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


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.


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.


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:+'

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


Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to gradle

Gradle - Move a folder from ABC to XYZ A failure occurred while executing com.android.build.gradle.internal.tasks Gradle: Could not determine java version from '11.0.2' Android Gradle 5.0 Update:Cause: org.jetbrains.plugins.gradle.tooling.util Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0 Failed to resolve: com.android.support:appcompat-v7:28.0 Failed to resolve: com.google.firebase:firebase-core:16.0.1 com.google.android.gms:play-services-measurement-base is being requested by various other libraries java.lang.NoClassDefFoundError:failed resolution of :Lorg/apache/http/ProtocolVersion Error - Android resource linking failed (AAPT2 27.0.3 Daemon #0)

Examples related to google-play-services

com.google.android.gms:play-services-measurement-base is being requested by various other libraries Error: fix the version conflict (google-services plugin) Google Play Services GCM 9.2.0 asks to "update" back to 9.0.0 updating Google play services in Emulator How to unpublish an app in Google Play Developer Console Android Studio Gradle: Error:Execution failed for task ':app:processDebugGoogleServices'. > No matching client found for package Error "File google-services.json is missing from module root folder. The Google Services Plugin cannot function without it" com.android.build.transform.api.TransformException How to add google-services.json in Android? google-services.json for different productFlavors