【发布时间】:2018-08-14 15:15:42
【问题描述】:
我刚刚将我的 Android Studio 从 2.3 升级到 3.0.1。但是我收到了这个错误信息(我已经安装了 API 27 )并且不知道如何修复它,因为我在新版本的 android studio 中找不到构建工具版本!
Error:Failed to find Build Tools revision 26.0.2 <a href="install.build.tools">Install Build Tools 26.0.2 and sync project</a>
gradle文件变了,项目结构也只有一个tab!
编辑: 这是`app/build.gradle的内容:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.m.finalocr"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
如您所见,其中没有buildToolsVersion。那么,当我的电脑上安装了 27 版本时,为什么我的 android studio 会寻找这个特定版本(26)?另外,我在哪里可以看到buildToolsVersion "26.0.2" and change it tobuildToolsVersion "27.0.3" `?
【问题讨论】:
-
如果未指定具体版本,则默认使用最新安装的版本。
-
作为 OP,我也发现情况并非如此。它只是要求一个较旧的版本,而没有在项目中的任何地方指定它。接受的答案并没有告诉我们它为什么要寻找那个特定的版本。
标签: android-studio configuration build-tools