Android App not working in 4.0 but working on 5+ Error inflating class android.support.design.widget.NavigationView

后端 未结 1 925
猫巷女王i
猫巷女王i 2021-01-17 03:07

Once run my app in 5.0+ versions it working nicely. but for lower version it gives me errors and not opening up.

This is the error I\'m getting:

1条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-17 03:58

    Finally after many days and after doing many debugs thanks to #0X0nosugar I have checked the navigationview by removing

    • app:headerLayout="@layout/nav_header_main"

    • app:menu="@menu/activity_main_drawer

    these two line separately and check the android monitor for errors

    
    

    removing app:headerLayout="@layout/nav_header_main" doesn't make any changes gives me the same error

    But after removing app:menu="@menu/activity_main_drawer" app works fine and load the left side navigation with no menu item. so as you can see in my error list it says Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f020052

    So I checked by removing custom vector icons in menu item I placed in my activity_main_drawer in res->menu . Its now working fine. problem with a one

    
            

    now its working fine.. Everyone who get this issue check your console. if its says "ResourceNotFoundException" this Error inflating class android.support.design.widget.NavigationView probably rising from one of the menu icon.. Finally Works for me! Thanks everyone for your great support

    0 讨论(0)
提交回复
热议问题