An error occurred during the Android development process when loading XML.

 java.lang.RuntimeException: Unable to start activity ComponentInfo{MainActivity}: android.view.InflateException: Binary XML file line #33: Binary XML file line #33: Error inflating class com.google.android.material.bottomnavigation.BottomNavigationView 

1 It can be seen from the error log that the error is caused by the BottomNavigationView initialization error.

2 from the Internet to find most people mean because of guide package is wrong, should use implementation “com. Google. Android. Material: material: $rootProject. AndroidXVersion”, Check the item is used correctly.

3 write a demo, load an empty BottomNavigationView, no problem, add code inside, set the menu also flash back. But the errors reported are different. The Error inflating the class.

4 Look up information on the Internet. Found because the RES image was not loaded. So if you see that the image is inside drawable 24, copy it inside drawable and it works. We can use this idea for reference.