Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle unable to resolve Play services dependency

I've got a clean Android project with Google Play services rev. 13 installed through the SDK manager, following these instructions.

My build.gradle file is as follows:

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

However, when I attempt to build this app, I get

Gradle: A problem occurred configuring project ':Maple'. > Failed to notify project evaluation listener.    > Could not resolve all dependencies for configuration ':Maple:_DebugCompile'.       > Could not find com.google.android.gms:play-services:4.0.30.         Required by:             MapleProject:Maple:unspecified 
like image 601
Randall Ma Avatar asked Nov 12 '13 06:11

Randall Ma


People also ask

Why is my gradle not syncing?

Why is my Gradle not syncing? Delete "build" folder from project's root folder. Then do "invalidate cache and restart". This will restart your Android Studio and then build the app again, will solve the issue.

What is gradle error in Android Studio?

In some cases when your Gradle files are deleted or corrupted you will not be able to download new Gradle files in android studio. In this case, we have to delete the Gradle files which are present already and then again sync your project to download our Gradle files again.

Where to put google JSON file in Android Studio?

The google-services. json file is generally placed in the app/ directory (at the root of the Android Studio app module).


2 Answers

Install the Google Repository in the SDK manager.

like image 192
Randall Ma Avatar answered Sep 17 '22 18:09

Randall Ma


Even if you have installed Google Repository in SDK Manager, you might still see the same error.

Another possible solution is to downgrade your version.

For example, instead of

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

Do

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

Notice 11.2.0 is advertised in Google's Set up Google Play Services page but it does not work for me.

like image 45
Clint Avatar answered Sep 17 '22 18:09

Clint