导入Holo Everywhere主题时出错

3

我已经按照几个网站的指南操作了,但仍无法使其正常工作。我确保已从现有源创建了项目,并将其包含为我的项目库,检查了目标等等。但我不确定我错过了什么。

我收到以下错误信息:

[2012-08-29 21:04:45 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values\styles.xml:246: error: Error: No resource found that matches the given name: attr 'windowActionBar'.
[2012-08-29 21:04:45 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values\styles.xml:247: error: Error: No resource found that matches the given name: attr 'windowNoTitle'.
[2012-08-29 21:04:45 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values-v14\styles.xml:12: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock'.
[2012-08-29 21:04:45 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values-v14\styles.xml:14: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock.Light'.
[2012-08-29 21:04:45 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values-v14\styles.xml:16: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock.Light.DarkActionBar'.
[2012-08-29 21:04:45 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values-v14\styles.xml:18: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock.ForceOverflow'.
[2012-08-29 21:04:45 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values-v14\styles.xml:20: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock.Light.ForceOverflow'.
[2012-08-29 21:46:56 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values\styles.xml:247: error: Error retrieving parent for item: No resource found that matches the given name '@style/Theme.HoloEverywhereDark.Sherlock'.
[2012-08-29 21:46:56 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values\styles.xml:253: error: Error retrieving parent for item: No resource found that matches the given name '@style/Theme.HoloEverywhereLight.Sherlock'.

所使用的指南:

导入HoloEverywhere出现错误

https://github.com/ChristopheVersieux/HoloEverywhere

3个回答

3
你提供的HoloEverywhere指南有点过时了,现在这两个主题分别被称为 Holo.ThemeHolo.Theme.Light
因此,请在你的 Android 清单文件中更改以下行:
android:theme="@style/Theme.HoloEverywhereDark.Sherlock"

或者

android:theme="@style/Theme.HoloEverywhereLight.Sherlock"

to

 android:theme="@style/Holo.Theme"

或者

android:theme="@style/Holo.Theme.Light"

然后选择“项目”->“清理”,看看错误是否消失。

0

我通过将所有项目的Android目标设置为最新的Android版本(目前为v.17)来解决了这个问题。


即使@georgiecasey的答案是正确的。如果您采用最新的更新,那么主题名称已更改。 - Jayshil Dave
抱歉,我以为你是原作者,对不起。 - Jayshil Dave

0

由于您正在使用Sherlock主题(而不是集成的Android主题),因此您需要在ProjectName /文件夹下导入该附加包

+ ProjectName

  1. src
  2. gen
  3. Android2.1
  4. Sherlock.jar(将该.jar文件导入根文件夹下)
  5. bin
  6. ......

我原本并不打算使用sherlock actionbar,但是我按照指南进行了操作,我认为错误就是从那里引起的。我找不到sherlock.jar,只能从现有代码中导入、制作库和包含库。 - user992244

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接