android - Android Studio 2.3未能找到构建工具

标签 android android-studio gradle

我很生气,将android studio 2.2更新为2.3后,我无法创建和编辑任何项目,因为gradle会出错:

Failed to find build tools revision 26.0.0 or any versions

我也从Android Studio下载了Gradle并构建了工具,但没有用。

我的gradle:
apply plugin: 'com.android.application'

android {

    compileSdkVersion 26

    buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId "atys.myapplication"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

和:
buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

dependencies {
}

最佳答案

您应该首先使用SDK Manager更新工具。
看此链接很有帮助。
https://developer.android.com/studio/intro/update.html

如果您的问题无法解决。卸载您的android studio并删除您的Sdk文件夹,然后从此链接重新安装android studio新版本:
https://developer.android.com/studio/index.html

关于android - Android Studio 2.3未能找到构建工具,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44774765/

相关文章:

Android:您可以向 Instant App 模块添加 Activity 吗?

android - 从 packageinfo 开始 Activity

java - 将gradle classpath依赖关系更新为3.1.1导致找不到符号类 list 错误

android - 在 android studio 的 Material 日期选择器中禁用日期

gradle - 次要Gradle升级中断测试编译

android - react-native运行Android构建错误-无法解决:com.android.support:appcompat-v7:26.0.2

android - Volley 作为依赖

android - NoClassDefoundError nineoldAndroid

Android studio 2.1.2 gradle aapt语法错误: Unterminated quoted string

Android如何做错综复杂的背景和边框