且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

迁移到androidX后无法运行该应用:android.view.InflateException

更新时间:2022-02-27 01:50:16

Caused by: android.view.InflateException: Binary XML file line #12: Binary XML file line #2: Error inflating class android.support.design.widget.CoordinatorLayout
Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.support.design.widget.CoordinatorLayout

根据这些,我想您在迁移到AndroidX时并没有更改依赖项和XML标签.不幸的是,重构">迁移到AndroidX"工具并不能为您完成此操作,不幸的是,它仅更改Java引用.有关更多信息,请参见.更改Gradle依赖项后,请在XML文件中将所有较旧的Android支持标签更改为较新的AndroidX标签.

From these, I would guess that you haven't changed your dependencies and XML tags when migrating to AndroidX. The Refactor > Migrate to AndroidX tool doesn't do that for you, unfortunately, it only changes Java references. See this for more information. When you are done changing the Gradle dependencies, please change all older Android support tags to newer AndroidX tags in your XML files.