新版Android studio新建工程build.gradle默认如下:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.2.1' apply false
id 'com.android.library' version '7.2.1' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
比如我们需要在项目根目录引入时,该如何下手,其实很简单直接在plugins 上方添加即可
classpath 'com.......'
方案:注意buildscript 需要放在plugins上方,否则会报错。
buildscript {
dependencies {
classpath 'com....'
}
}
plugins {
id 'com.android.application' version '7.2.1' apply false
id 'com.android.library' version '7.2.1' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}