Version 28 (intended for Android Pie and below) is the last version of the legacy support library
发布日期:2021-06-30 11:11:19 浏览次数:2 分类:技术文章

本文共 950 字,大约阅读时间需要 3 分钟。


版权声明

  • 本文原创作者:谷哥的小弟
  • 作者博客地址:http://blog.csdn.net/lfdfhl

概述

新版Android Studio在添加依赖时报错:

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语句仍然报错,可能是库的版本较低,出现了不兼容的现象。

3、由于原来的support 库太乱了,谷歌在新版本中取消了support库,使用了新的andriodX库。

迁移到 AndroidX

为了解决上述问题,我们需要将原理的support库迁移到AndroidX并使用implementation添加依赖。详细步骤如下:

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

转载地址:https://it9527.blog.csdn.net/article/details/105269551 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:ExpandableListView结合CheckBox实现单选的完整示例
下一篇:ImageView设置边框的两种方式

发表评论

最新留言

感谢大佬
[***.8.128.20]2024年04月29日 06时28分52秒