[英]Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light'
I am getting this error in styles.xml: 我在styles.xml中收到此错误:
Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light'. 检索项目的父项时出错:找不到与给定名称“android:Theme.Material.Light”匹配的资源。
In manifest: 在清单中:
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="21" />
Android Sdk Manager: Android Sdk经理:
I am updated all the api 21 and extras. 我更新了所有的api 21和额外内容。
In Order and Export : 在订单和出口 :
values-v21/styles.xml: 值-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'.
I didn't know why this error still occurs.Anybody can help me with this.Thank you. 我不知道为什么这个错误仍然存在。任何人都可以帮助我。谢谢。
Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light'. 检索项目的父项时出错:找不到与给定名称“android:Theme.Material.Light”匹配的资源。
Material.Light
theme require API level 21 for project. Material.Light
主题需要API级别21才能用于项目。 Set Project Build Target for project from Properties->Android->Project Build Target
to API 21
. 将项目的项目构建目标从Properties->Android->Project Build Target
为API 21
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.