“No resource identifier found for attribute 'showAsAction' in package 'android'”

北战南征 提交于 2019-11-27 01:15:33

If you are building with Eclipse, make sure your project's build target is set to Honeycomb too.

Saurabh

remove android:showAsAction="never" from res/menu folder from every xml file.

kumar kundan

all above fix may not work in android studio .if you are using ANDROID STUDIO...... use this fix

add

xmlns:compat="http://schemas.android.com/tools"

in menu tag instead of

xmlns:compat="http://schemas.android.com/apk/res-auto"

in menu tag.

Add "android-support-v7-appcompat.jar" to Android Private Libraries

Add compat library compilation to the build.gradle file:

compile 'com.android.support:appcompat-v7:19.+'

The problem is related to AppCompat library. With it, you have

xmlns:appname="http://schemas.android.com/apk/res-auto"

and possibly:

appname:showAsAction="never"

in menu.xml file.

Without the lib, you can only have:

android:showAsAction="never"

and my app works with menu both on Android 4.3 and 2.3.3.

Check your compileSdkVersion on app build.gradle. Set it to 21:

compileSdkVersion 21

go to gradle and then to app.buildgradle then set compileSDKVersion to 21 and then if necessary the android studio will download some files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!