Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am attempting to update my android application to look better for tablets running Honeycomb. As such, I am targeting version 11 of the SDK (my minSdkVersion = 4). This adds the Honeycomb theme to my app, making it look better. However, I have no way to access my menu options. So, I am attempting to add my menu items as an action bar item with the following in the file in my /res/menu/ folder:

android:showAsAction="ifRoom|withText"

However, I get the following error:

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

I tried altering my minSdkVersion number to 11 to see if it would work, but no luck. Any ideas? Thanks!

like image 960
ariets Avatar asked Mar 10 '11 14:03

ariets


3 Answers

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

like image 166
Jason Hanley Avatar answered Sep 23 '22 22:09

Jason Hanley


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

like image 34
Saurabh Avatar answered Sep 20 '22 22:09

Saurabh


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.

like image 22
kumar kundan Avatar answered Sep 23 '22 22:09

kumar kundan