findViewById(R.id.icon) returns null
R.id.icon is already defined in Android API level 1. However, I am getting an NPE in a Android Design Support Library internal code while accessing an imageview inflated using R.id.icon . NOTE: I am not targetting Oreo as my targetSdk is currently 25 . Here is the stacktrace: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.ViewGroup$LayoutParams android.widget.ImageView.getLayoutParams()' on a null object reference at android.support.design.internal.BottomNavigationItemView.setChecked(BottomNavigationItemView.java:172) at android.support.design