好的,所以我是android开发的初学者,我刚创建了hello world app.但是它给了我库中styles_base.xml文件的错误appcompat_v7.
错误:检索项目的父项时出错:找不到与给定名称"android:Widget.Material.ActionButton"匹配的资源.styles_base.xml/appcompat_v7/res/values-v21
AAPT问题
我该如何处理这个错误?另外,为什么我不想要appcompat_v7库?我的意思是如何在不使用appcompat_v7库的情况下创建hello world应用程序?
这是styles_base.xml给出上述错误的文件.
<resources>
<!-- Like in themes_base.xml, the namespace "*.AppCompat.Base" is used to
define base styles for the platform version. The "*.AppCompat"
variants are for direct use or use as parent styles by the app. -->
<eat-comment/>
<style name="Base.Widget.AppCompat.ActionBar.TabView"
parent="android:Widget.Material.ActionBar.TabView">
</style>
<style name="Base.Widget.AppCompat.Light.ActionBar.TabView"
parent="android:Widget.Material.Light.ActionBar.TabView">
</style>
<style name="Base.Widget.AppCompat.ActionBar.TabText"
parent="android:Widget.Material.ActionBar.TabText">
</style>
<style name="Base.Widget.AppCompat.Light.ActionBar.TabText"
parent="android:Widget.Material.Light.ActionBar.TabText">
</style>
<style name="Base.Widget.AppCompat.Light.ActionBar.TabText.Inverse"
parent="android:Widget.Material.Light.ActionBar.TabText">
</style>
<style name="Base.TextAppearance.AppCompat.Widget.ActionBar.Menu"
parent="android:TextAppearance.Material.Widget.ActionBar.Menu">
</style>
<style name="Base.TextAppearance.AppCompat.Widget.ActionBar.Title"
parent="android:TextAppearance.Material.Widget.ActionBar.Title">
</style>
<style name="Base.TextAppearance.AppCompat.Widget.ActionBar.Subtitle"
parent="android:TextAppearance.Material.Widget.ActionBar.Subtitle"> …Run Code Online (Sandbox Code Playgroud) 我在styles.xml文件中写了一个主题,如下所示
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Root styles that vary by API level -->
<style name="FrameworkRoot.Theme" parent="Theme.Sherlock.Light.DarkActionBar">
<!-- API 11+ (compatibility) -->
<item name="buttonBarStyle">@style/Compat.ButtonBar</item>
<item name="buttonBarButtonStyle">@style/Compat.ButtonBarButton</item>
<item name="indeterminateProgressStyle">@style/Compat.IndeterminateProgress</item>
<!-- API 14+ (compatibility) -->
<item name="listPreferredItemPaddingLeft">@dimen/compat_list_preferred_item_padding_left</item>
<item name="listPreferredItemPaddingRight">@dimen/compat_list_preferred_item_padding_right</item>
<item name="listPreferredItemHeightSmall">@dimen/compat_list_preferred_item_height_small</item>
</style>
Run Code Online (Sandbox Code Playgroud)
但得到错误:错误:找不到与给定名称匹配的资源:attr'buttonBarStyle'.
我从谷歌io2012获得代码.我和它的所有基地
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
Run Code Online (Sandbox Code Playgroud)
我可以编译谷歌io2012的源代码,但不是我的.这么奇怪.有谁知道为什么?或者有同样的问题?
我有最新的eclipse ADT插件:ADT-23.0.4.
Eclipse版本:Luna Service Release 1(4.4.1).
导入项目时我仍然收到此错误:
无法解决目标'android-21'