I have a question very similar to Gradle build fails looking for Google Play Services in Android Studio
I have a working android project but when I add
compile 'com.google.android.gms:play-services:5.0.77'
I get a gradle build error
Error:Failed to find: com.google.android.gms:play-services:5.2.8
<a href="openFile">Open File</a><br><a href="open.dependency.in.project.structure">Open in Project Structure dialog</a>
I have added the SDKs through the manager. Other threads have suggested that there might be a second SDK library on the computer causing the issue, but I have not been able to resolve this. I am using a mac (and normally a PC user so please bear with me) and looking at the SDK manager and the project structure dialog both say the SDK is located at:
/Applications/Android Studio.app/sdk
Given they are pointing to the same place it must be some other cause of the error?
Maybe I have a version other than 5.2.8 (although unlikely, as andoid studio says this is the most up to date and I have just updated the SDK)? How can I check the version installed on my machine - its not in the file names?
Android Studio uses Gradle, an advanced build toolkit, to automate and manage the build process, while allowing you to define flexible custom build configurations. Each build configuration can define its own set of code and resources, while reusing the parts common to all versions of your app.
If you are going to use version 5.2.8 you have to set on your build.gradle
compile 'com.google.android.gms:play-services:5.2.08'
Because it is store on the directory :
ANDROID_SDK_PATH/extras/google/m2repository/com/google/android/gms/play-services/5.2.08
You can use '+' instead '08' and you will be using the last minor version
compile 'com.google.android.gms:play-services:5.2.+'
OK so it looks as though my version number was off and thats all that was causing the problem. If anyone else has this issue check your version number in the AndroidManifest.xml file in the google_play_services_lib directory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With