我试图更新我的项目,我正在像2016年一样工作,我正在将代码中的所有内容从gradle版本更新到28.0.0
更新时出现了一个我从未见过的错误:
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...
this is line 28 from the code build.gradle ( implementation 'com.android.support:appcompat-v7:28.0.0' )
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...
implementation 'com.android.support:design:28.0.0'
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...
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
字符串
我试着更新一切到最新版本,并从android studio库检查,但我失败了,也许我做错了什么?
1条答案
按热度按时间t0ybt7op1#
经过对错误的一些研究。我发现要解决这个问题,你应该迁移到AndroidX。这是关于如何迁移的完整文档:https://developer.android.com/jetpack/androidx/migrate
结论是要迁移到AndroidX,您应该遵循以下步骤:
使用Android Studio 3.2及更高版本,您可以通过从菜单栏中选择重构>迁移到AndroidX,将现有项目迁移到AndroidX。
refactor命令使用了两个标志。默认情况下,在
gradle.properties
文件中,这两个标志都设置为true:android.useAndroidX=true
Android插件使用适当的AndroidX库而不是支持库。android.enableJetifier=true
Android插件通过重写现有第三方库的二进制文件,自动迁移现有第三方库以使用AndroidX。