"No resource identifier found for attribute 'showAsAction' in package 'android'"

you must choose an API 14 with version of 4.0 or grater because any version below 4.0 does not contain in its package the showAsAction attribute


Are you sure you are looking in the right *.xml file? You seem to look for "showAsAction" in layout xmls, but it's parameter for the menu. Look rather into .../menu/your_activity.xml

The problem you are dealing with is connected with using target less than 4.0 and/or API less than 14.

So,

a) change those parameters,

b) change the value of showAsAction from "never" to "ifRoom".


I had this problem when I forgot to add appcompat-v7:+ to my project dependencies. You can do it like this in build.gradle:

dependencies {
  compile 'com.android.support:appcompat-v7:+'
}

And this is because I had the following in my menu.xml:

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

and

app:showAsAction="never"

When I removed the xmlns:app namespace and just used android:showAsAction="never", I didn't need the appcompat-v7 library anymore.


This happens if you have used the resourceidentifier "ShowAsAction" in your XML. This feature is available only from ver11 i guess. If you are trying to run the same on a lower API version this errror is produced. SOLUTION ->> Right click the project > Properties > Android> Build Target > Choose something greater than API 11