黑马程序员技术交流社区

标题: 创建新的Android项目,Eclipse自动创建appcompat_v7出错,如何解决 [打印本页]

作者: imxuimxu    时间: 2014-10-23 00:03
标题: 创建新的Android项目,Eclipse自动创建appcompat_v7出错,如何解决
我的ADT的版本是最高的23.0,创建新的android项目,会出现appcompat_v7的内容。
最小ADT我选的API10,最高的选的API20。

出现的appcompat_v7这个是为了兼容版本的问题,不过我的appcompat_v7会出现很多错误,错误如下:
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:75: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton'.
[2014-10-22 23:50:52 - test]
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:79: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.CloseMode'.
[2014-10-22 23:50:52 - test]
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:83: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.Overflow'.
[2014-10-22 23:50:52 - test]
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:25: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabView'.
[2014-10-22 23:50:52 - test]
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:29: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabView'.
[2014-10-22 23:50:52 - test]
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:33: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabText'.
[2014-10-22 23:50:52 - test]
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:37: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'.
[2014-10-22 23:50:52 - test]
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:41: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'.
[2014-10-22 23:50:52 - test]
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:65: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Title'.
[2014-10-22 23:50:52 - test]
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:69: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Subtitle'.
[2014-10-22 23:50:52 - test]
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:45: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Menu'.
[2014-10-22 23:50:52 - test]
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:49: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'.
[2014-10-22 23:50:52 - test]
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:53: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'.
[2014-10-22 23:50:52 - test]
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:57: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title.Inverse'.
[2014-10-22 23:50:52 - test]
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:61: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle.Inverse'.
[2014-10-22 23:50:52 - test]
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:178: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar.Horizontal'.
[2014-10-22 23:50:52 - test]
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:182: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar'.
[2014-10-22 23:50:52 - test]
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:113: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner'.
[2014-10-22 23:50:52 - test]
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:115: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner'.
[2014-10-22 23:50:52 - test]
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:110: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.DropDownItem.Spinner'.
[2014-10-22 23:50:52 - test]
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:107: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView.DropDown'.
[2014-10-22 23:50:52 - test]
[2014-10-22 23:50:52 - test] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:121: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView'.
[2014-10-22 23:50:52 - test]
作者: imxuimxu    时间: 2014-10-23 00:04
[2014-10-22 23:50:55 - appcompat_v7] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:75: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton'.
[2014-10-22 23:50:55 - appcompat_v7]
[2014-10-22 23:50:55 - appcompat_v7] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:79: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.CloseMode'.
[2014-10-22 23:50:55 - appcompat_v7]
[2014-10-22 23:50:55 - appcompat_v7] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:83: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.Overflow'.
[2014-10-22 23:50:55 - appcompat_v7]
[2014-10-22 23:50:55 - appcompat_v7] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:25: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabView'.
[2014-10-22 23:50:55 - appcompat_v7]
[2014-10-22 23:50:55 - appcompat_v7] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:29: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabView'.
[2014-10-22 23:50:55 - appcompat_v7]
[2014-10-22 23:50:55 - appcompat_v7] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:33: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabText'.
[2014-10-22 23:50:55 - appcompat_v7]
[2014-10-22 23:50:55 - appcompat_v7] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:37: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'.
[2014-10-22 23:50:55 - appcompat_v7]
[2014-10-22 23:50:55 - appcompat_v7] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:41: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'.
[2014-10-22 23:50:55 - appcompat_v7]
[2014-10-22 23:50:55 - appcompat_v7] D:\BaiduYunDownload\workspace\appcompat_v7\res\values-v21\styles_base.xml:65: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Title'.
[2014-10-22 23:50:55 - appcompat_v7]


像这样的错误还有很多,由于限制发的字数我就不在多发了
作者: imxuimxu    时间: 2014-10-23 00:06
我上网也找了一些方法,像这样的方法:
解决项目建成后appcompat_v7包出错。test包出现红色警告的问题。
点击菜单栏"Project",选择"Clean",然后点击"OK",Clean完成后,你会发现appcompat_v7包出错。test包出现红色警告的问题已经解决了,只是test包还有黄色警告,那只是因为test的Java文件中import的类没有被使用,所以完全不用管它。
如果还不管用,那么右键appcompat_v7包,选择Properties,点"Android",如果Library栏下的"Is Library"方框没勾选,则勾选上,点击"OK",然后再照以上步骤执行"Clean"操作即可。

但是我这样做之后还是没有任何改变,还是出现以上的错误,我对上面出现的代码实在不是很了解,希望各位高手能帮我分析一下,有什么解决的方案。
作者: imxuimxu    时间: 2014-10-23 00:09
我现在知道的唯一能解决问题的办法是:在新建项目的时候把minimum required sdk选择android 4.0以上版本就不会出现那个了。
不过这样低版本的ADT就不支持了。
我现在真的是不知道怎么解决这个appcompat_v7出错情况。希望有高人能指点迷津
作者: 沙拉很好吃    时间: 2014-10-23 09:43
10下面还没有那么多的values配置,如果配置为10,需要删除
作者: imxuimxu    时间: 2014-10-23 15:19
沙拉很好吃 发表于 2014-10-23 09:43
10下面还没有那么多的values配置,如果配置为10,需要删除

什么意思,没明白:dizzy:




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2