自 2020 年 7 月起,您可以执行以下操作:
将此添加到您的build.gradle
文件中(对于项目,而不是应用程序)
dependencies {
classpath 'com.android.tools:r8:2.0.88' // Must be before the Gradle Plugin for Android.
// in addition to everything else that was here ....
}
整个文件应该是这样的,供参考:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools:r8:2.0.88' // Must be before the Gradle Plugin for Android.
classpath 'com.android.tools.build:gradle:4.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}