No resource identifier found for attribute 'headerLayout' in package错误解决方法
来源:互联网 发布:婚庆网站源码 编辑:程序博客网 时间:2024/05/19 13:21
我在使用NavigationView这个控件的时候出现了以下的错误:
Error:(2) No resource identifier found for attribute 'headerLayout' in package 'com.example.administrator.learndrewablelayout'
Error:(2) No resource identifier found for attribute 'menu' in package 'com.example.administrator.learndrewablelayout'
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'F:\Android\SDK\build-tools\24.0.2\aapt.exe'' finished with non-zero exit value 1
我的xml文件内容如下:
<?xml version="1.0" encoding="utf-8"?><android.support.design.widget.NavigationView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/nv_main_menu" android:layout_height="match_parent" android:layout_width="match_parent" android:layout_gravity="start" android:clickable="true" app:headerLayout="@layout/activity_main_menu_head" app:menu="@menu/activity_main_menu_item"></android.support.design.widget.NavigationView>
解决方法:
在build.gradle中添加如下:
compile 'com.android.support:design:24.1.1'
在我的build.gradle文件中是这样的
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:design:24.1.1' compile 'com.android.support:appcompat-v7:24.1.1'}
添加上面那一句之后我的问题就可以解决了。。。。。。
1 0
- No resource identifier found for attribute 'headerLayout' in package错误解决方法
- No resource identifier found for attribute 'headerLayout' in package错误解决方法
- android报Error:No resource identifier found for attribute 'roundIcon' in package 'android'错误解决方法
- no resource identifier found for attribute 'lable' in package 'android'
- No resource identifier found for attribute 'showAsAction' in package 'android'
- No resource identifier found for attribute 'showAsAction' in package 'android'
- error: No resource identifier found for attribute ‘backIcon’ in package
- No resource identifier found for attribute 'paddingEnd' in Package 'android'
- error: No resource identifier found for attribute ‘XXXXXX’ in package
- No resource identifier found for attribute 'parentActivityName' in package 'android'
- No resource identifier found for attribute X in package X
- No resource identifier found for attribute 'pstsIndicatorColor' in package
- error: No resource identifier found for attribute ‘backIcon’ in package
- error: No resource identifier found for attribute ‘footerColor’ in package
- No resource identifier found for attribute 'showAsAction' in package 'android'
- No resource identifier found for attribute 'showAsAction' in package
- No resource identifier found for attribute 'showAsAction' in package 'XXX'
- No resource identifier found for attribute 'ptr_duration_to_close' in package
- Oracle总结(1)
- Android Fragment应用实战,使用碎片向ActivityGroup说再见
- myeclipse10 离线安装svn插件,以及svn的使用
- 拯救无法启动的虚拟机文件.vmdk中的数据
- 利用JDBC访问MySQL数据库
- No resource identifier found for attribute 'headerLayout' in package错误解决方法
- 阴阳师妖怪出处(简洁版)
- RandomAccessFile
- css注意事项06
- weed-fs因网络环境发生改变导致服务器不能正常相应的修正记录
- 利用pipework开源网络配置工具配置docker容器网络和host主机网络在同一个网段
- PHP程序员的技术成长规划
- void指针(void *的用法)
- iOS UIMenuController的使用