2 qq 27899227 qq_27899227 于 2015.06.21 10:54 提问

新建android工程 报错,大神看过来

[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]

4个回答

frank_20080215
frank_20080215   2015.06.21 11:11

当你的androidAPI 由2.1版本更换成2.2版本时:
res/vavlues/styles.xml中使用的android:WindowTitle会报以下异常,
error: Error retrieving parent for item: No resource found that matches the given name 'android:WindowTitle'.
从而导致我们的程序无法编译通过。

原因:
android2.1中的某些API(包括类方法或者XML属性)更换成android2.2时,它们的路径已经发生了改变,从而导致编译器无法找到它们,所以编译无法通过。

解决方案:
1. 在Eclipse中打开任意一个.java文件,输入
android.R.style.
这时你会看到一个提示列表,仔细看看,里面确实没由WindowTitle, 但是我们发现了一个TextAppearance_WindowTitle. 没错, 在android2.2中,它已经被改成了TextAppearance_WindowTitle。

  1. 回到报错的res/values/styles.xml, 将 <br> 相应地修改成<br> <style name="XWindowTitle" parent="android:TextAppearance.WindowTitle"></p> <p>注意:这里你也许会注意到 .java文件中的XML属性,与 .xml文件中XML属性很是类似。<br> 这不是巧合,android官方文档规定:<br> java文件中的android.R.style.TextAppearance_WindowTitle 对应<br> xml文件中的android:TextAppearance.WindowTitle。 “下划线”与“点”时对应关系。</p></li> </ol>

qq_35607456
qq_35607456   2016.07.14 19:49

安装最新版SDK也没用啊 新建工程依旧报错

baitianjun
baitianjun   2015.06.21 23:19

选择最新的版本作为编译/目标版本,没有的话就下载更新sdk吧

sy039
sy039   2015.06.25 00:24

一劳永逸的方法:打开sdk manager,翻墙更新sdk。

Csdn user default icon
上传中...
上传图片
插入图片