解决Eclipse创建Android项目时出现No resource found that matches the given name ‘Theme.AppCompat.Light’的问题

首先,对于该问题的详细分析大家可以查看Theme.AppCompat.Light问题的深入分析一文,里面详细介绍了该问题出现的原因。

简单来讲,就是新的eclipse默认模版主题UI需要使用比较高版本api,如果需要支持低版本,需要导入appCompact库来支持。网上有许多解决办法,但是我这里只介绍一种方法,因为其他我看到的方法都需要手动去项目里改东西,也就是说你没建一个新项目都需要去操作,这样会很麻烦。

最好的方法就是导入android-support-v7-appcompat库。具体如下:

通过Android SDK Manager下载最新的Android Support Library

但是可能会出现,SDK Manager中没有该选项,网上给出的解决方案都是利用更换镜像源来解决的。但是现在baidu能找到的镜像中都不包括该项,同时经过我的实践,更换镜像源确实不能解决问题。

这里大家可以通过手动下载Android Support Library文件夹引入工程项目,下载地址如下Android Support Library下载。若该网址打不开,则可去自行搜索。下载之后解压缩,是一个包含很多内容的support文件夹。把该文件夹复制粘贴放\sdk\extras\android路径下,再次打开SDK Manager就可看见Android Support Library选项。

我在上述步骤完成之后,就可成功创建Android项目了,若大家还是存在问题,可在Theme.AppCompat.Light问题的深入分析一文查找解决办法。

已标记关键词 清除标记
[2015-06-21 09:40:53 - HellowWord] F:\eclipse 32\workspace\HellowWord\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 09:40:53 - HellowWord] [2015-06-21 09:40:53 - HellowWord] F:\eclipse 32\workspace\HellowWord\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 09:40:53 - HellowWord] [2015-06-21 09:40:53 - HellowWord] F:\eclipse 32\workspace\HellowWord\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. [2015-06-21 09:40:53 - HellowWord] [2015-06-21 09:40:55 - HellowWord] F:\eclipse 32\workspace\HellowWord\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 09:40:55 - HellowWord] [2015-06-21 09:40:55 - HellowWord] F:\eclipse 32\workspace\HellowWord\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 09:40:55 - HellowWord] [2015-06-21 09:40:55 - HellowWord] F:\eclipse 32\workspace\HellowWord\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. [2015-06-21 09:40:55 - HellowWord] [2015-06-21 09:41:00 - HellowWord] F:\eclipse 32\workspace\HellowWord\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 09:41:00 - HellowWord] [2015-06-21 09:41:00 - HellowWord] F:\eclipse 32\workspace\HellowWord\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 09:41:00 - HellowWord] [2015-06-21 09:41:00 - HellowWord] F:\eclipse 32\workspace\HellowWord\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. [2015-06-21 09:41:00 - HellowWord] [2015-06-21 09:54:11 - HellowAndroid] F:\eclipse 32\workspace\HellowAndroid\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 09:54:11 - HellowAndroid] [2015-06-21 09:54:11 - HellowAndroid] F:\eclipse 32\workspace\HellowAndroid\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 09:54:11 - HellowAndroid] [2015-06-21 09:54:11 - HellowAndroid] F:\eclipse 32\workspace\HellowAndroid\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. [2015-06-21 09:54:11 - HellowAndroid] [2015-06-21 09:54:13 - HellowAndroid] F:\eclipse 32\workspace\HellowAndroid\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 09:54:13 - HellowAndroid] [2015-06-21 09:54:13 - HellowAndroid] F:\eclipse 32\workspace\HellowAndroid\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 09:54:13 - HellowAndroid] [2015-06-21 09:54:13 - HellowAndroid] F:\eclipse 32\workspace\HellowAndroid\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. [2015-06-21 09:54:13 - HellowAndroid] [2015-06-21 09:54:14 - HellowAndroid] F:\eclipse 32\workspace\HellowAndroid\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 09:54:14 - HellowAndroid] [2015-06-21 09:54:14 - HellowAndroid] F:\eclipse 32\workspace\HellowAndroid\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 09:54:14 - HellowAndroid] [2015-06-21 09:54:14 - HellowAndroid] F:\eclipse 32\workspace\HellowAndroid\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. [2015-06-21 09:54:14 - HellowAndroid] [2015-06-21 10:11:03 - HellowWorld] F:\eclipse 32\workspace\HellowWorld\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 10:11:03 - HellowWorld] [2015-06-21 10:11:03 - HellowWorld] F:\eclipse 32\workspace\HellowWorld\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 10:11:03 - HellowWorld] [2015-06-21 10:11:03 - HellowWorld] F:\eclipse 32\workspace\HellowWorld\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. [2015-06-21 10:11:03 - HellowWorld] [2015-06-21 10:11:04 - HellowWorld] F:\eclipse 32\workspace\HellowWorld\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 10:11:04 - HellowWorld] [2015-06-21 10:11:04 - HellowWorld] F:\eclipse 32\workspace\HellowWorld\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 10:11:04 - HellowWorld] [2015-06-21 10:11:04 - HellowWorld] F:\eclipse 32\workspace\HellowWorld\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. [2015-06-21 10:11:04 - HellowWorld] [2015-06-21 10:11:05 - HellowWorld] F:\eclipse 32\workspace\HellowWorld\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 10:11:05 - HellowWorld] [2015-06-21 10:11:05 - HellowWorld] F:\eclipse 32\workspace\HellowWorld\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 10:11:05 - HellowWorld] [2015-06-21 10:11:05 - HellowWorld] F:\eclipse 32\workspace\HellowWorld\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. [2015-06-21 10:11:05 - HellowWorld] [2015-06-21 10:46:52 - HellowWorld1] F:\eclipse 32\workspace\HellowWorld1\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 10:46:52 - HellowWorld1] [2015-06-21 10:46:52 - HellowWorld1] F:\eclipse 32\workspace\HellowWorld1\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 10:46:52 - HellowWorld1] [2015-06-21 10:46:52 - HellowWorld1] F:\eclipse 32\workspace\HellowWorld1\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. [2015-06-21 10:46:52 - HellowWorld1] [2015-06-21 10:46:54 - HellowWorld1] F:\eclipse 32\workspace\HellowWorld1\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 10:46:54 - HellowWorld1] [2015-06-21 10:46:54 - HellowWorld1] F:\eclipse 32\workspace\HellowWorld1\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 10:46:54 - HellowWorld1] [2015-06-21 10:46:54 - HellowWorld1] F:\eclipse 32\workspace\HellowWorld1\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. [2015-06-21 10:46:54 - HellowWorld1] [2015-06-21 10:47:05 - HellowWorld1] F:\eclipse 32\workspace\HellowWorld1\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 10:47:05 - HellowWorld1] [2015-06-21 10:47:05 - HellowWorld1] F:\eclipse 32\workspace\HellowWorld1\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. [2015-06-21 10:47:05 - HellowWorld1] [2015-06-21 10:47:05 - HellowWorld1] F:\eclipse 32\workspace\HellowWorld1\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. [2015-06-21 10:47:05 - HellowWorld1]
©️2020 CSDN 皮肤主题: 像素格子 设计师:CSDN官方博客 返回首页