Error inflating class com.google.android.material.navigation.NavigationView after migration to AndroidX

别来无恙 提交于 2019-12-05 18:08:35

There are multiple reasons why this error can occur. Check the following and make sure they are proper:

  • Check your code for drawable and color resources used inside the com.google.android.material.navigation.NavigationView you've used, probably in activity_main.xml, if you're using the default Navigation Drawer template code from Android Studio.
  • Check that the drawable files are in res/drawable folder, not in res/drawable-v21.
  • Check if you've used android:backgroundTint() or android:src or similar inside your NavigationView. Since they don't work below android API Level 21, use app:backgroundTint or app:srcCompat instead.

android.view.InflateException: means there is something wrong in your XML file itself.

Please check all your dimensions, color resources, and other resources you have assigned in the XML tag.

Or post your XML file here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!