我需要添加2.3及更高版本的操作栏.
我最近才知道appcompat v7支持库,这样做是正确的.
我已经按照Support library setup guide,一步一步,清理,建立和清理,重新启动eclipse,升级SDK和插件到最后一个版本(只是为了意识到SDK build tools v19 are broken,所以我不得不删除它们).两个小时后,我仍然无法建立我的项目.我得到这些错误:
[2013-11-13 00:00:00 - FooProject] D:\foo_project\android-support-v7-appcompat\res\values-v11\themes_base.xml:33: error: Error: No resource found that matches the given name: attr 'android:windowActionBar'. [2013-11-13 00:00:00 - FooProject] D:\foo_project\android-support-v7-appcompat\res\values-v11\themes_base.xml:42: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light'. [2013-11-13 00:00:00 - FooProject] D:\foo_project\android-support-v7-appcompat\res\values-v11\themes_base.xml:44: error: Error: No resource found that matches the given name: attr 'android:windowActionBar'. [2013-11-13 00:00:00 - FooProject] D:\foo_project\android-support-v7-appcompat\res\values-v14\themes_base.xml:31: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo'. [2013-11-13 00:00:00 - FooProject] D:\foo_project\android-support-v7-appcompat\res\values-v14\themes_base.xml:41: error: Error: No resource found that matches the given name: attr 'android:actionBarWidgetTheme'. [2013-11-13 00:00:00 - FooProject] D:\foo_project\android-support-v7-appcompat\res\values-v14\themes_base.xml:57: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light'. [2013-11-13 00:00:00 - FooProject] D:\foo_project\android-support-v7-appcompat\res\values-v14\themes_base.xml:67: error: Error: No resource found that matches the given name: attr 'android:actionBarWidgetTheme'. [2013-11-13 00:00:00 - FooProject] D:\foo_project\android-support-v7-appcompat\res\values-v14\themes_base.xml:83: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar'. [2013-11-13 00:00:00 - FooProject] D:\foo_project\android-support-v7-appcompat\res\values-v14\themes_base.xml:94: error: Error: No resource found that matches the given name: attr 'android:actionBarWidgetTheme'.
我在以下问题中尝试过一切,无济于事:
Adding Support Libraries to Android project
After setting up android-support-v7-appcompat R.java is missing
Android Support Library v7: Error retrieving parent for item
@L_502_5@
How to resolve the error “No resource found that matches the given name” when adding library v7 AppCompat in Eclipse?
我不是说这些答案是无效的,只是因为某些原因他们没有为我工作(我认为是因为Google讨厌我).
这是我的目标sdk的清单线:
图书馆:
<uses-sdk android:minSdkVersion="7"/>
并为主要项目:
<uses-sdk android:targetSdkVersion="19" android:minSdkVersion="8"/>
尝试每一个可能的组合,每次更改后的清洁和建设,仍然没有运气.
看起来这是一个与Holo有关的问题.我真的不需要Holo,只有ActionBar.现在我只是转向ActionBarSherlock,这对我来说过去很好.但是,我真的很想知道我做错了什么,为什么有些事情无法工作,尽管我花了大量时间研究这个问题.为什么集成一个应该可以开箱即用的库的痛苦.