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'
}