2015-01-07 11 views
9

私はのstyles.xmlにこのエラーを取得しています:アイテムの親を取得エラー:リソースは、指定された名前と一致し見つからない「アンドロイド:Theme.Material.Light」

エラー:いいえリソースを指定された名前 'android:Theme.Material.Light'に一致する に一致しました。マニフェストで

<uses-sdk 
    android:minSdkVersion="16" 
    android:targetSdkVersion="21" /> 

のAndroid SDKマネージャー:私はすべてのAPI 21とエキストラを更新しています

enter image description here

ために

enter image description here

エクスポート

enter image description here

値-V21 /のstyles.xml:

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
    <style name="AppTheme" parent="android:Theme.Material.Light"> 

     <item name="android:colorPrimary">@color/primary</item> 
     <item name="android:colorPrimaryDark">@color/primary_dark</item> 
     <item name="android:colorAccent">@color/accent</item> 
     <item name="android:textColorPrimary">@color/text_primary</item> 
     <item name="android:textColor">@color/text_secondary</item> 
     <item name="android:navigationBarColor">@color/primary_dark</item> 

    </style> 
</resources> 

コンソール:

E:\workspace\WelcomeToL\app\src\main\res\values-v21\styles.xml:3: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light'. 

E:\workspace\WelcomeToL\app\src\main\res\values-v21\styles.xml:7: error: Error: No resource found that matches the given name: attr 'android:colorAccent'. 

E:\workspace\WelcomeToL\app\src\main\res\values-v21\styles.xml:5: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'. 

E:\workspace\WelcomeToL\app\src\main\res\values-v21\styles.xml:6: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'. 

E:\workspace\WelcomeToL\app\src\main\res\values-v21\styles.xml:10: error: Error: No resource found that matches the given name: attr 'android:navigationBarColor'. 

このエラーはまだoccurs.Anybodyがthis.Thankあなたと私を助けることができますなぜ私は知りませんでした。

答えて

9

アイテムの親を取得中にエラーが発生しました:指定された名前が「android:Theme.Material.Light」の に一致するリソースが見つかりませんでした。

Material.Lightテーマは、プロジェクトのAPIレベル21が必要です。 プロジェクトのビルドターゲットProperties->Android->Project Build TargetからAPI 21に設定します。

+1

targetSdkVersionは21より低くなりますが、compileSdkVersionは21より大きい必要があります – maxb3k

関連する問題