解决报错问题 Error inflating class android.support.design.widget.NavigationView

解决报错问题
Error inflating class android.support.design.widget.NavigationView

错误提示:

java.lang.RuntimeException:Unable to start activity ComponentInfo{software.monster.day0302design/software.monster.day0302design.MainActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class android.support.design.widget.NavigationView```


解决方法:
请检查appcompat-v7版本与design版本是否一致。若不一致,请改为一致即可。

compile ‘com.android.support:appcompat-v7:23.1.1’
compile ‘com.android.support:design:23.1.1’ “`


就像图中一样,包的版本号尽量一致,这样就避免此类的错误.

你可能感兴趣的:(编译报错解决)