最近装了预览版的 Android Studio( android-studio-2022.3.1.15 Giraffe ),新建项目后想修改 Gradle 插件版本,在网上搜索到的都是说修改 classpath
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
但是新建的项目 build.gradle 中内容并不是这样的,如下:
看了官网文档,内容虽然不一样,但是修改 Gradle 版本还是在这里。
Android Gradle 插件版本说明
又去下载了老版本的 Android Studio,新建的项目中 build.gradle 内容有classpath。
Android Studio 历史版本