Android调试错误-No resource identifier found for attribute 'showAsAction'

简介:

  今天在研究有米广告技术时,第一次编译他们提供的Android示例工程,结果出现如下错误:

[2014-11-29 11:28:25 - com.youmi.android.offerdemo.YoumiOffersAdsDemo] 

W/ResourceType(15184): Bad XML block: header size 201 or total size 0 is larger 

than data size 0

[2014-11-29 11:28:25 - com.youmi.android.offerdemo.YoumiOffersAdsDemo] E:

\download2010\tuiguang\youmi\youmi_android_offerwall_sdk_v4.10_2014-11-

24\YoumiAndroidSdk\demo\offers\res\menu\main.xml:3: error: No resource identifier 

found for attribute 'showAsAction' in package 'android'


  经过从网络中不少文章的参考分析基本确定,出现上述错误的原因在于XML内容存在错误,从而导致无法生成R.java文件。此时,.java文件中也出现R资源无法找到相应错误。而且,编译时也会出现类似于上面的错误。


   解决办法主要有两种途径:

1,修改可能的XML文件中错误;

2,Android SDK版本可能不对,从而使attribute 'showAsAction'等在低版本中得到不到支持。


我这方面,正是第二种情况所致:我把android 2.3.3修改为4.0,再编译便OK了。参考一下下面的图形吧。

wKioL1R5R3PCIIiiAAL70Nkqb8E140.jpg

















本文转自朱先忠老师51CTO博客,原文链接:http://blog.51cto.com/zhuxianzhong/1584423 ,如需转载请自行联系原作者



相关文章
|
开发工具 Android开发 git
解决Android AAPT: error: resource android:attr/lStar not found. 问题
解决Android AAPT: error: resource android:attr/lStar not found. 问题
1061 0
【Bug】Android resource linking failed和error: failed linking references.
【Bug】Android resource linking failed和error: failed linking references.
|
开发工具 Android开发
Android Studio resource linking failed
Android Studio resource linking failed
305 1
|
XML Android开发 数据格式
【安卓开发】ArrayAdapter requires the resource ID to be a TextView
【安卓开发】ArrayAdapter requires the resource ID to be a TextView
209 0
【安卓开发】ArrayAdapter requires the resource ID to be a TextView
|
Android开发
AAPT: error: resource android:attr/dialogCornerRadius not found.
AAPT: error: resource android:attr/dialogCornerRadius not found.
271 0
|
Android开发
AAPT: error: resource android:attr/lStar not found.
AAPT: error: resource android:attr/lStar not found.
2259 0
AAPT: error: resource android:attr/lStar not found.
|
Android开发
android studio 查看无效resource
android studio 查看无效resource
android studio 查看无效resource
|
Android开发
解决bug:在eclipse中导入Android项目时报错: “invalid resource directory name bin/res/crunch”
解决bug:在eclipse中导入Android项目时报错: “invalid resource directory name bin/res/crunch”
657 0
|
Android开发
【Android】解决TextView.setText提示Do not concatenate text displayed with setText. Use resource string
【Android】解决TextView.setText提示Do not concatenate text displayed with setText. Use resource string =
413 0

热门文章

最新文章