无法运行Android应用程序并出现错误:检索项目错误的父项时出错

时间:2015-02-28 03:32:37

标签: android eclipse android-appcompat

我最近安装了eclipse并设置了用于android开发的库,我刚从eclipse创建了一个新的android应用程序,配置为 最小版本为2.2,目标版本为4.1.2,编译版本为4.1.2。当我在创建项目后清理项目时,我在控制台中遇到了很多错误,如下所示

[Date - SwipingTabs] /home/user/workspace/appcompat_v7/res/values-v21/themes_base.xml:117: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
[Date - SwipingTabs] 
[Date - SwipingTabs] /home/user/workspace/appcompat_v7/res/values-v21/themes_base.xml:155: error: Error: No resource found that matches the given name: attr 'android:colorAccent'.
[Date - SwipingTabs] 
[Date - SwipingTabs] /home/user/workspace/appcompat_v7/res/values-v21/themes_base.xml:157: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'.
[Date - SwipingTabs] 
[Date - SwipingTabs] /home/user/workspace/appcompat_v7/res/values-v21/themes_base.xml:158: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'.
[Date - SwipingTabs] 
[Date - SwipingTabs] /home/user/workspace/appcompat_v7/res/values-v21/themes_base.xml:156: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'.
[Date - SwipingTabs] 
[Date - SwipingTabs] /home/user/workspace/appcompat_v7/res/values-v21/themes_base.xml:153: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
[Date - SwipingTabs] 
[Date - SwipingTabs] /home/user/workspace/appcompat_v7/res/values-v21/themes_base.xml:154: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
[Date - SwipingTabs] 
[Date - SwipingTabs] /home/user/workspace/appcompat_v7/res/values-v21/themes_base.xml:192: error: Error: No resource found that matches the given name: attr 'android:colorAccent'.
[Date - SwipingTabs] 
[Date - SwipingTabs] /home/user/workspace/appcompat_v7/res/values-v21/themes_base.xml:194: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'.
[Date - SwipingTabs] 
[Date - SwipingTabs] /home/user/workspace/appcompat_v7/res/values-v21/themes_base.xml:195: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'.
[Date - SwipingTabs] 
[Date - SwipingTabs] /home/user/workspace/appcompat_v7/res/values-v21/themes_base.xml:193: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'.
[Date - SwipingTabs] 
[Date - SwipingTabs] /home/user/workspace/appcompat_v7/res/values-v21/themes_base.xml:190: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
[Date - SwipingTabs] 
[Date - SwipingTabs] /home/user/workspace/appcompat_v7/res/values-v21/themes_base.xml:191: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
[Date - SwipingTabs] 

我不知道为什么会出现这些错误,而且我也无法运行该项目。

我的项目属性是

enter image description here

enter image description here

enter image description here

此外,我观察到当我创建项目时,在我的工作区中创建了一个新的文件夹appcompat_7文件夹,但是它有错误

同样,当我打开MainActivity.java时,R发生错误,说R cannot be resolved to a variable

有人知道如何解决这些错误吗?

1 个答案:

答案 0 :(得分:0)

您正在使用最后一个appcompat v21。

您必须使用API​​21编译项目。