binkpitch
binkpitch

Reputation: 717

Unable to resolve dependencies for Android SDK Tools

I can't install Android SDK Tools on Android Studio (version 2.3).

I got the following error, Unable to resolve dependencies for Android SDK Tools

Is there anyway I can solve this error?

Upvotes: 17

Views: 4862

Answers (7)

Arman Ordookhani
Arman Ordookhani

Reputation: 6556

Update your SDK tools from old "SDK Manager" UI (You can find it at <your SDK>/tools/android) to 25.2.5 then update it from Android Studio to latest version (26.1.1).

For some reasons you can't see newer versions in SDK Manager UI.

Upvotes: 0

kwiqsilver
kwiqsilver

Reputation: 1027

Google fixed this, on the server side, shortly after discovery. It should work now.

Upvotes: 0

Siddharth
Siddharth

Reputation: 9584

Ok, I think I found the solution. Please try it out and report back on comments. Build is a success, but I still need to test by app to check for features and other possible side effects. Did not want everyone to wait until this is resolved. If this does not work or has serious issues, I am happy to delete this answer.

PLEASE COMMENT

The solution

  1. I commented out

    compile 'com.google.android.gms:play-services:x.y.z'

  2. I also removed

    com.google.android.gms:play-services-appindexing com.google.android.gms:play-services-contextmanager

  3. Upgraded the remaining com.google.android.gms:* services to 10.2.0

This is my working build.gradle with no errors

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.2'
    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 25
        multiDexEnabled = true
    }

    def applicationVersion = '*****'

    dexOptions {
//        incremental = true;   // If anybody use below 2.2.2 android studio then please uncomment this line. It's by default true.
        preDexLibraries = false
        javaMaxHeapSize "2g"
    }

    signingConfigs {
        ....
    }

    buildTypes {
        ...
    }

    productFlavors {
       ...
    }

    packagingOptions {
        ...
    }
}

dependencies {
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:support-v4:25.1.1'
 //    compile 'com.google.code.gson:gson:2.2.4'

    compile 'com.fasterxml.jackson.core:jackson-core:2.6.1'
    compile 'com.fasterxml.jackson.core:jackson-annotations:2.6.1'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.6.1'
    compile 'com.android.support:appcompat-v7:25.1.1'
    compile 'com.android.support:design:25.1.1'
    compile 'com.crittercism:crittercism-android-agent:+'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.google.android.gms:play-services:10.2.0'
    compile 'com.google.android.gms:play-services-base:10.2.0'
//    compile 'com.google.android.gms:play-services-appindexing:10.2.0'
//    compile 'com.google.android.gms:play-services-contextmanager:10.2.0'
    compile 'com.google.android.gms:play-services-places:10.2.0'
    compile 'com.google.android.gms:play-services-nearby:10.2.0'
    compile 'com.google.android.gms:play-services-maps:10.2.0'
//    compile 'com.google.android.gms:play-services-ads:10.2.0'
//    compile 'com.google.android.gms:play-services-auth:10.2.0'
    compile 'com.google.android.gms:play-services-gcm:10.2.0'
    compile 'com.google.android.gms:play-services-analytics:10.2.0'
    compile 'com.google.android.gms:play-services-location:10.2.0'
//    compile 'com.google.android.gms:play-services-awareness:10.2.0'
//    compile 'com.google.android.gms:play-services-cast:10.2.0'
//    compile 'com.google.android.gms:play-services-plus:10.2.0'
    compile 'com.google.maps.android:android-maps-utils:0.4.+'
    compile 'com.google.zxing:core:3.2.0'
    compile 'com.journeyapps:zxing-android-embedded:3.3.0@aar'
    compile 'com.google.firebase:firebase-messaging:10.2.0'
    compile 'com.google.firebase:firebase-core:10.2.0'
    compile 'com.google.firebase:firebase-analytics:10.2.0'
    compile 'com.flurry.android:analytics:6.4.2'
    ....
}
apply plugin: 'com.google.gms.google-services'

Upvotes: 0

Phileo99
Phileo99

Reputation: 5659

TLDR; no.

Google, for whatever reason, has decided to remove direct access to the standalone SDK Manager starting with Android STudio v2.3. If you run SDK manager directly using @iK2H 's instructions, you will see that SDK manager does not detect Android SDK Tools v25.3.1. It could be that v25.3.1 is only available via Android Studio settings, but this is broken for now.

Your best best is to upvote this issue to draw attention to Google to fix it.

Upvotes: 3

iK2H
iK2H

Reputation: 11

  1. Open the terminal
  2. $ cd "sdk path"/tools
  3. $ ./android
  4. Update

Upvotes: 1

BryanOS Dev
BryanOS Dev

Reputation: 1

From Windows, search for SDK Manager and right click to 'run as administrator'. Attempt to the install it from there.

Was having the same issue and that worked for me...

Upvotes: 0

matdziu
matdziu

Reputation: 13

File -> Invalidate Caches / Restart or Build -> Clean Project can help (let me know if it did)

Upvotes: 0

Related Questions