无法解决Android SDK工具的依赖关系

17

我无法在Android Studio(版本2.3)上安装Android SDK工具。

我收到以下错误信息: 无法解决Android SDK工具的依赖关系

是否有任何方法可以解决这个错误?


1
今天早上更新了Android Studio到2.3,但是还是遇到了同样的错误。仍在努力解决中。 - Somesh Kumar
你能否启动独立的SDK管理器? - Monish Kamble
自今天升级至Android Studio 2.3后,我也遇到了同样的问题。启动SDK管理器没有问题。@MonishKamble - SLearner
1
您尝试过从那里更新吗?如果是,您收到了什么错误信息? - Monish Kamble
7个回答

3
TLDR; 不行。
由于某种原因,Google决定从Android Studio v2.3开始取消对独立SDK Manager的直接访问。 如果您按照@iK2H的指示直接运行SDK管理器,您会发现SDK管理器无法检测到Android SDK Tools v25.3.1。 可能是v25.3.1仅通过Android Studio设置可用,但目前此功能已损坏。 您最好投票支持此问题(此链接),以引起Google的注意并修复它。

我也确实遇到了这个问题。我的本地开发机可以更新到25.3.1,但是Circle CI持续集成服务器最多只能更新到25.2.5。 - Lance Nanek

1
  1. 打开终端
  2. $ cd "sdk路径"/tools
  3. $ ./android
  4. 更新

1
事实上,这个SDK Tools 25.3.1并不存在。在dl.google.com上显示404页面 -> 链接 - iK2H

0

从Windows开始,搜索SDK Manager并右键单击以“以管理员身份运行”。尝试从那里安装它。

我遇到了同样的问题,这对我有用...


由于某些原因,Android Tools 25.3.1在SDK Manager中不可见。更新仅在Android Studio中报告。 - Alen Siljak

0

Google已经在发现后很快修复了这个问题,现在应该可以正常工作了。


2
我仍然无法在我的Android Studio上看到更新选项。 - Sahil Garg

0

文件 -> 无效缓存 / 重启 或者 构建 -> 清理项目 可以帮助解决问题(如果有用请告诉我)


3
对我来说不起作用(尝试将工具从25.2.5更新到25.3.1)。 - aghidini
这对我不起作用。我能够通过sdkmanager安装25.2.5,但像@aghidini一样,在升级到25.3.1时遇到问题(相同的错误)。 - binkpitch
清除缓存对我无效。正在尝试在Android Studio v2.3上升级到25.3.1。 - SLearner
对我也不起作用。该死的工作室完全不稳定。 - Siddharth

0

从旧的“SDK Manager” UI(您可以在<your SDK>/tools/android中找到它)更新您的SDK工具到25.2.5,然后从Android Studio更新到最新版本(26.1.1)。

由于某些原因,您可能无法在SDK Manager UI中看到更新的版本。


0

好的,我想我已经找到了解决方案。请尝试并在评论中汇报。构建成功了,但我仍然需要测试我的应用程序以检查功能和其他可能的副作用。我不希望每个人都等到这个问题解决才能继续。如果这个方法不起作用或存在严重问题,我很乐意删除此答案。

请评论

解决方案

  1. 我注释掉了

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

  2. 我还去掉了

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

  3. 升级了其余的 com.google.android.gms:*服务至10.2.0

这是我的工作中没有错误的build.gradle

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'

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接