2015-06-18 76 views
0

錯誤:錯誤檢索的項目父:沒有資源發現在給定名稱匹配 'Theme.AppCompat.Light.NoActionBar'

<!-- Base application theme. --> 
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> 
    <!-- Customize your theme here. --> 
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item> 
    <item name="colorPrimary">@color/colorPrimary</item> 
    <item name="colorAccent">@color/colorAccent</item> 
    <item name="android:textColorPrimary">@color/colorTextPrimary</item> 
    <item name="android:textColorSecondary">@color/colorTextSecondary</item> 
</style> 

這是styles.xml文件。下面的代碼導致這個錯誤 - 我已經把所有必要的庫和jar文件,我也嘗試改變語法的一點點和許多東西,但我無法解決問題。這是非常重要的。請幫幫我。謝謝。

我試過以下內容: 您需要在Android項目中引用此AppCompat庫。

將庫導入Eclipse。

右鍵單擊您的Android項目。 選擇屬性。 點擊底部的「添加...」添加庫。選擇支持庫 清理並重建您的項目。

它仍然不起作用。現在

編輯:

我已經安裝了Android SDK中5.0(API 21),但它仍然無法正常工作。該錯誤的行是 在此文件(styles.xml)中安裝android sdk 5.0(API 21)之前還有3個錯誤,但現在它們消失了。請幫我刪除剩餘的錯誤。

+0

改變這個'家長=「@風格/ Theme.AppCompat.Light.DarkActionBar」' – Pankaj

+0

可能的重複[找不到與名稱'@ style/Theme.AppCompat.Light'匹配的資源](http://stackoverflow.com/questions/21059612/no-resource-found-that-matches-the-given- name-style-theme-appcompat-light) –

+0

我想保留NoActionBar,但即使我把@ style /作爲前綴它不起作用 –

回答

0

如果您在使用清單材料,你會如果你的分版本不是API 21收到此錯誤

相關問題