Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDan Badertscher
5,327 PointsError Message "Error:(4) No resource identifier found for attribute 'showAsAction' in package 'AppTest.funfacts'"
I am trying to run the Fun Facts project for the first time and I am getting the following message:
Error:(4) Execution failed for task ':app:processDebugResources'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command:
How do I go about fixing this?
Dan Badertscher
5,327 PointsThe layout XML is:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".FunFactsActivity">
<TextView
android:text="@string/hello_world"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
Dan Badertscher
5,327 PointsThe menu XML is:
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context=".FunFactsActivity"> <item android:id="@+id/action_settings" android:title="@string/action_settings" android:orderInCategory="100" app:showAsAction="never" /> </menu>
1 Answer
James Simshaw
28,738 PointsHello,
Your xml looks right, so the likely issue is that you need to include
dependencies {
compile 'com.android.support:appcompat-v7:+'
}
in your build.gradle file for your app(not the project build.gradle file).
James Simshaw
28,738 PointsJames Simshaw
28,738 PointsHello,
Could you post your layout XML files to make it easier to assist you?