NavigationView throwing error: No resource identifier found for attribute 'menu' in package

Make sure you have the correct dependency to the Android Design Support Library. It's easy to choose the wrong one - because it seems that Google posted two different dependency strings:

At the time of this answer, the Android developer blog (and the comment by user hungryghost) had the correct dependency string, while the dependency string on the Support library homepage did not work.

Use this one: compile 'com.android.support:design:26.1.0'

Note that the version is 22.2.0 (wrong: 22.0.0) and that the package is called design (wrong: support-design)

After these changes use the Android Studio menu "Rebuild project", or the "Sync" button that appears sometimes after changing the gradle file. That finally made it work for me.


Add the below line to app gradle file.

dependencies { .....

  • implementation 'com.android.support:design:26.1.0'

....

}

for gradle version 3.0.1