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库。

Android 依赖报错Version 28 (intended for Android Pie and below) is the last version of the legacy_第1张图片

解决方案如下:
Refactor->Migrate to AndroidX->点击左下角 Do Refactor
(refactor:n.重构)(Migrate:v.迁移)
解决前:
在这里插入图片描述
解决后:
在这里插入图片描述

更多相关文章

  1. Android SDK版本和ADT版本
  2. android 设置app版本号
  3. 【Android Studio】Android Studio和Gradle版本兼容性说明
  4. Android7.0升级版本适配问题
  5. Android 版本号对应的SDK版本
  6. Android 各个版本号WebView
  7. android sdk adt 版本
  8. Android com.android.support 版本不一致
  9. android系统中“关于设备”中android版本和android安全补丁信息

随机推荐

  1. android copybit
  2. Android――ViewGroup的一个用法实例(转
  3. android用户界面之TabHost教程实例汇总
  4. Android应用开发相关下载资源(2014/10/19
  5. 从零开始 WIN8.1 下Android(安卓)开发环
  6. 如何在android画分析图(例如 柱状图、趋势
  7. Android使用贝塞尔线高仿QQ聊天消息气泡
  8. Will android (java) UUID.randomUUID()
  9. android:configChanges="orientation|key
  10. Android(安卓)Intent