2015-01-07 6 views
9

Ich erhalte diesen Fehler in styles.xml:Fehler Eltern für Artikel Abrufen: keine Ressource gefunden, die den angegebenen Namen übereinstimmt ‚android: Theme.Material.Light‘

Fehler Eltern für Artikel Abrufen: keine Ressourcen gefunden, dass die Vornamen 'android: Theme.Material.Light' entspricht.

In manifestieren:

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

Android Sdk Manager:

Ich aktualisiert bin die alle api 21 und Extras.

enter image description here

enter image description here

in Ordnung und Export:

enter image description here

Werte-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> 

Console:

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'. 

Ich weiß nicht, warum dieser Fehler noch occurs.Anybody mich mit this.Thank Ihnen helfen können.

Antwort

9

Fehler für Artikel Abrufen parent: Keine Ressource gefunden, dass entspricht dem Vornamens 'android: Theme.Material.Light'.

Material.Light Thema erfordern API-Ebene 21 für das Projekt. Set Projekt Build Target für Projekt von Properties->Android->Project Build Target bis API 21.

+1

targetSdkVersion könnte niedriger als 21 sein, aber compileSdkVersion muss> = 21 sein – maxb3k