Qas Qas - 2 years ago 607
Android Question

Android Studio: Failed to resolve:

When I try to compile I get this error
"Failed to resolve:" in Android Studio. I am trying to include the play services in my project. This is my build.gradle file:

apply plugin: ''

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
applicationId "Application name"
minSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "1.0"
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),''

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile ''
compile ''

The only thing I have changed in this file is this line:

compile ''

I have installed Google Play Services and it's version number is 30.

Answer Source

I had the same issue yesterday. In the messages section when running a gradle sync or build, I got a message with an option to update something from the M2 repo. Clicking the link downloaded the latest version and fixed the issue.

You could also try compile ''

If you are only using maps, consider only downloading maps using compile '' as it can save you hitting the 65K method dex limit later in development.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download