Android 依赖报错Version 28 (intended for Android Pie and below) is the last version of the legacy
16lz
2021-01-23
Version 28 (intended for Android Pie and below) is the last version of the legacy support library, so we recommend that you migrate to AndroidX libraries when using Android Q and moving forward. The IDE can help with this: Refactor > Migrate to AndroidX... less... (Ctrl+F1) Inspection info:There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion). Issue id: GradleCompatible
总结原因如下:
1.由于Android Studio 版本较高,添加库依赖已经不支持compile语句,较高的版本应使用implementation或者api语句。
2.若使用api或implementation语句仍然报错,可能是库的版本较低,出现了不兼容的现象。
关于报错信息大概意思:
依赖库28号版本是Android Pie 以及以下的版本最新的一个版本,对于Android Q以及以上版本应使用AndroidX库。由于support 库太乱了,谷歌在新版本中取消了support库,使用了新的andriodX库。
解决方案如下:
Refactor->Migrate to AndroidX->点击左下角 Do Refactor
(refactor:n.重构)(Migrate:v.迁移)
解决前:
解决后:
更多相关文章
- Android SDK版本和ADT版本
- android 设置app版本号
- 【Android Studio】Android Studio和Gradle版本兼容性说明
- Android7.0升级版本适配问题
- Android 版本号对应的SDK版本
- Android 各个版本号WebView
- android sdk adt 版本
- Android com.android.support 版本不一致
- android系统中“关于设备”中android版本和android安全补丁信息