AndroidStudio 3.4 3.5 以上版本关闭 AndroidX 使用

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
}

发布了55 篇原创文章 · 获赞 20 · 访问量 21万+

猜你喜欢

转载自blog.csdn.net/Kennethdroid/article/details/104275614