1. 根目录下修改 gradle.properties
文件
#是否使用AndroidX库
android.useAndroidX=false
#是否迁移第三方库
android.enableJetifier=false
2. 第一步无效时,请降低 gradle 版本
修改根目录下的 build.gradle
文件,使用 3.1.4 或以下版本。
// 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.build:gradle:3.1.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}