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...
1.点击Refactor->Migrate to Androidx
2.去除勾选,然后点击Migrate
3.点击Do Refactor后等一会,错误解决了。
4.错误得以解决的前后变化