我尝试在新安装的Android Studio(今天)中打开一个旧项目,但出现了以下错误:
failed to find build tools revision 23.0.0 rc2
install build tools 23.0.0 rc2 and sync project
我在互联网上搜索并尝试将此内容添加到gradle文件中:
android {
compileSdkVersion 22
buildToolsVersion "22.0.0"
}
然后它给了我另一个错误:
gradle DSL method not found: 'android()'
possible causes:
the project may be using a version of gradle that does not contain the method.
gradle settings.
the build file may be missing a gradle plugin.
apply gradle plugin.
这是我的Gradle文件:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
}
}
allprojects {
repositories {
jcenter()
}
}
android {
compileSdkVersion 22
buildToolsVersion "22.0.0"
}