Title: Why it says there's error "No resource found that matches" even though it exists?
Tags: android
Question: Error Message
error: Error: No resource found that matches the given name (at 'style' with value '@style/rightBehindMenuScroll').
layout/activity_behind_right_simple.xml
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/rightBehindMenuScroll" &gt;
<LinearLayout style="@style/behindMenuScrollContent"
android:paddingTop="25dp" &gt;
<TextView
style="@style/behindMenuItemTitle"
android:text="Right" /&gt;
<TextView
style="@style/behindMenuItemLabel"
android:text="Item0" /&gt;
<TextView
style="@style/behindMenuItemLabel"
android:text="Item1" /&gt;
<Button
android:id="@+id/behind_btn"
style="@style/behindMenuItemLabel"
android:text="BUTTON" /&gt;
</LinearLayout&gt;
</ScrollView&gt;
values/styles.xml
<resources&gt;
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
--&gt;
<style name="AppBaseTheme" parent="android:Theme.Light"&gt;
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
--&gt;
</style&gt;
<!-- Application theme. --&gt;
<style name="AppTheme" parent="AppBaseTheme"&gt;
<!-- All customizations that are NOT specific to a particular API-level can go here. --&gt;
</style&gt;
<style name="leftBehindMenuScroll"&gt;
<item name="android:layout_width"&gt;240dp</item&gt;
<item name="android:layout_height"&gt;fill_parent</item&gt;
<item name="android:background"&gt;@drawable/leftbg</item&gt;
</style&gt;
<style name="rightBehindMenuScroll"&gt;
<item name="android:layout_width"&gt;200dp</item&gt;
<item name="android:layout_height"&gt;fill_parent</item&gt;
<item name="android:background"&gt;@drawable/rightbg</item&gt;
</style&gt;
<style name="behindMenuScrollContent"&gt;
<item name="android:layout_width"&gt;fill_parent</item&gt;
<item name="android:layout_height"&gt;fill_parent</item&gt;
<item name="android:orientation"&gt;vertical</item&gt;
<item name="android:padding"&gt;8dp</item&gt;
</style&gt;
<style name="behindMenuItemTitle"&gt;
<item name="android:layout_width"&gt;wrap_content</item&gt;
<item name="android:layout_height"&gt;wrap_content</item&gt;
<item name="android:layout_marginLeft"&gt;8dp</item&gt;
<item name="android:layout_marginBottom"&gt;8dp</item&gt;
<item name="android:textSize"&gt;22sp</item&gt;
<item name="android:textColor"&gt;#FFFFFF</item&gt;
</style&gt;
<style name="behindMenuItemLabel"&gt;
<item name="android:layout_width"&gt;wrap_content</item&gt;
<item name="android:layout_height"&gt;wrap_content</item&gt;
<item name="android:layout_marginLeft"&gt;8dp</item&gt;
<item name="android:layout_marginBottom"&gt;8dp</item&gt;
<item name="android:textSize"&gt;18sp</item&gt;
<item name="android:textColor"&gt;#FFFFFF</item&gt;
</style&gt;
</resources&gt;
Comment: have you tried cleaning your project?

Comment: Are you using Studio or Eclipse? The Gradle build system is a bit temperamental when it comes to resources. Try removing the `build/` folder.


Here is another answer: Thats b'coz you are using styles.xml instead of style.xml.
Try changing referance as follows...
<TextView
style="@styles/behindMenuItemTitle"
android:text="Right" /&gt;
in same way with all other referances of styles.xml file...
Comment for this answer: I replaced all `@style` with `@styles` but it still says `error: Error: No resource found that matches the given name (at 'style' with value '@style/RightBehindMenuScroll').`
Comment for this answer: This answer is wrong. `@styles` is incorrect syntax. The filename `styles.xml` is completely irrelevant and can be anything you want.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 2, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2013:00:08/10/13', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<android>', 'Title': 'Why it says there\'s error "No resource found that matches" even though it exists?', 'ViewCount': 1386, 'id': 18162655, 'user_AboutMe': '', 'user_AccountId': 2123384.0, 'user_DisplayName': 'HUSTEN', 'user_Reputation': 4957.0, 'user_Views': 303.0, 'user_id': 1886175.0}}