导入一个项目。此项目之前没有升级androidx库
android编译,报错信息如下:
This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
The following AndroidX dependencies are detected: androidx.annotation:annotation:1.0.0
百度了一下说是,需要加上:
android.useAndroidX=true
android.enableJetifier=true
加上之后又报错:
import android.support.v7 找不到
百度了很久无法解决,请大神帮忙看下啊。
那就把这个导入的地方删除。
然后依赖一个appcomapt
Androidx没有android.support这样的包的,转换详情请看官方的文档吧。
https://developer.android.google.cn/jetpack/androidx
androidx就是整理了下android.support库。如果需要跟换,去查查对应的映射关系表就好了
参考https://blog.csdn.net/tgvincent/article/details/102460897