Android Studio升级到3.5后,原先项目引入的是android,现在新建module时有Project needs to be converted to androidx.* dependencies,而且Finish是灰色,无法创建。

现在提供两种解决方法

一、将项目升级到AndroidX
https://blog.csdn.net/weixin_40420578/article/details/100132061

二、项目不升级到AndroidX

按步骤来:

1、项目的 gradle.properties 文件中修改:

android.useAndroidX=true
android.enableJetifier=true

2、新建 Module

new --> Module -->选择 Android Library -->这时就不会提示了,并且可以Finsh了

3、因为新建的Module 是AndroidX的,所以需要将 Module 改为 Android

​ 3-1 项目的 gradle.properties 文件中修改:

android.useAndroidX=false
android.enableJetifier=false

​ 3-2 在 Module 中 build.gradle 中修改如下,将所有 涉及到Androidx的地方修改为Android

defaultConfig {
        ...
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        ...
    }

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
}
GitHub 加速计划 / de / Dependencies
36
1
下载
A rewrite of the old legacy software "depends.exe" in C# for Windows devs to troubleshoot dll load dependencies issues.
最近提交(Master分支:13 天前 )
1997a400 - 3 年前
2f423539 - 3 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐