Android Error : No resource found that matches the given name 'Theme.AppCompat.Light'.

来源:互联网 发布:网咖身份证件软件 编辑:程序博客网 时间:2024/04/27 16:10

在eclipse中创建android项目时如图:
这里写图片描述
如果Minimum Required SDK选择版本过低就会出现下列问题:
[2016-06-30 00:04:47 - test] D:\Documents\Android_Workspace\test\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name ‘Theme.AppCompat.Light’.
[2016-06-30 00:04:47 - test]
[2016-06-30 00:04:47 - test] D:\Documents\Android_Workspace\test\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name ‘Theme.AppCompat.Light.DarkActionBar’.
[2016-06-30 00:04:47 - test]

暂时解决办法:将Minimum Required SDK版本调至Android 4.0(API14)以上。
原因:简单来说就是新的eclipse默认模版主题UI需要使用比较高版本api,如果需要支持低版本,需要导入appCompact库来支持,网上一般给出的解法:

1、File->Import (android-sdk\extras\android\support\v7). Choose “appcompat”
2、Project-> properties->Android. In the section library “Add” and choose “appCompat”

0 0
原创粉丝点击