Я получаю эту ошибку в styles.xml:
Ошибка получения родительского элемента для элемента: ресурс не найден, который соответствует указанному имени «android: Theme.Material.Light».
В манифесте:
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="21" />
Android Sdk Manager:
Я обновляю все api 21 и дополнения.
В заказе и экспорте :
Значения-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'.
Я не знал, почему эта ошибка все еще встречается. Любой может помочь мне с этим. Спасибо.
Ошибка получения родительского элемента для элемента: ресурс не найден, который соответствует указанному имени «android: Theme.Material.Light».
Тема Material.Light
требует API уровня 21 для проекта. Задайте Project Build Target для проекта из Properties->Android->Project Build Target
для API 21
.