使用HoloEverywhere将Holo主题添加到2.3.6 /错误

时间:2012-12-05 14:58:33

标签: android

如何在我的应用中使用holoevery?

将库添加到我的项目时出现以下错误 指南:

Error importing HoloEverywhere

`[2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values\abs__styles.xml:214: error: Error: No resource found that matches the given name: attr 'android:spinnerMode'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:63: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Spinner'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:65: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.Spinner'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:68: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ListView.DropDown'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:70: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ListView.DropDown'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:73: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.PopupWindow'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:75: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.PopupWindow'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values\abs__styles.xml:258: error: Error: No resource found that matches the given name: attr 'android:animationResolution'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:78: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ProgressBar'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:80: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ProgressBar'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:83: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ProgressBar.Horizontal'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:85: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ProgressBar.Horizontal'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:88: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.AutoCompleteTextView'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:90: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.AutoCompleteTextView'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values\abs__styles.xml:328: error: Error: No resource found that matches the given name: attr 'android:textAllCaps'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:93: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Menu'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:96: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Title'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:98: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Title.Inverse'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:100: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Subtitle'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:102: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Subtitle.Inverse'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:104: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionMode.Title'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:106: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionMode.Title.Inverse'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:108: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionMode.Subtitle'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:110: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionMode.Subtitle.Inverse'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:113: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.PopupMenu'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:115: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.PopupMenu.Large'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:117: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.PopupMenu.Large'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:119: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.PopupMenu.Small'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__styles.xml:121: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.PopupMenu.Small'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v11\abs__themes.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v11\abs__themes.xml:6: error: Error: No resource found that matches the given name: attr 'android:windowActionBar'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__themes.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v11\abs__themes.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v11\abs__themes.xml:10: error: Error: No resource found that matches the given name: attr 'android:windowActionBar'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__themes.xml:6: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__themes.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__themes.xml:14: error: Error: No resource found that matches the given name: attr 'android:actionBarWidgetTheme'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__themes.xml:22: error: Error: No resource found that matches the given name: attr 'android:windowActionBar'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__themes.xml:26: error: Error: No resource found that matches the given name: attr 'android:windowActionBar'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values\abs__themes.xml:196: error: Error: No resource found that matches the given name: attr 'android:windowActionBar'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values\abs__themes.xml:197: error: Error: No resource found that matches the given name: attr 'android:windowActionModeOverlay'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values\abs__themes.xml:198: error: Error: No resource found that matches the given name: attr 'android:windowCloseOnTouchOutside'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__themes.xml:30: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Dialog'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values\abs__themes.xml:222: error: Error: No resource found that matches the given name: attr 'android:windowActionBar'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values\abs__themes.xml:223: error: Error: No resource found that matches the given name: attr 'android:windowActionModeOverlay'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values\abs__themes.xml:224: error: Error: No resource found that matches the given name: attr 'android:windowCloseOnTouchOutside'.
 [2012-12-05 20:23:11 - com.sditya.quadratic.equation.Quadratic] C:\Users\aditya\workspace\ActionBarSherlock\library\res\values-v14\abs__themes.xml:32: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.Dialog'.`

或者告诉我是否有另一种简单的方法可以在2.3.6

上运行的应用中添加Holo黑暗主题

2 个答案:

答案 0 :(得分:4)

如果你没有解决问题,我找到了解决方法。我已经在HoloEverywhere提供的DemoActivity应用程序上完成了它,但我认为在你的应用程序中使用它也不会有问题。

最重要的是导入所有图书馆项目,顺序并不重要:

  • 图书馆文件夹中的HoloEverywhere图书馆
  • slidemenu文件夹中的滑动菜单
  • 来自contrib / ActionBarSherlock库的ActionBarSherlock库

首先关闭所有不相关的项目,因为它们的错误/警告将从问题控制台中消失,因此更容易找到连接到HoloEverywhere的项目。

之后,请确保您拥有所有清单文件

<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="16" />

你甚至可以改变16到17,因为它是最新的SDK。对此行的最短解释意味着,此应用可以在任何SDK设备上运行,其SDK大于7且低于16。

然后,对于所有添加的库,尽可能更改项目构建目标(我将4.2)。我认为至少它必须是SDK14(4.0)。您将看到目标已被更改,因为在项目树中您将拥有具有适当的android目标库的文件夹。我必须警告你,更改此文件夹可能需要一两分钟 - 继续观察进度条。

如何更改项目构建目标:

项目名称上的鼠标右键 - &gt;属性[在列表的底部几乎](或当项目名称在菜单栏项目 - &gt;属性上突出显示时) 在左侧打开的窗口中 - &gt; Android - &gt;右侧面板并选择正确的目标。然后应用并确定。

最后一件事是清理每个项目(同样可能需要一段时间,特别是如果你有自动构建选项): 菜单栏 - &gt;项目 - &gt;清洁 - &gt;选择与此相关的所有项目(如果您关闭的所有项目都不相关,那么您应该只看到此应用程序的项目)而不是确定。

多亏了这一点,你将使用更高版本的SDK中的内容重建你的R文件,这样你就可以在代码中引用它们了。

现在你不应再有任何错误,只有警告。

如果您仍然有一些问题在下面发表评论,也许我可以帮助您。

要显示它在那里工作,请从运行Android 2.3.4的实际设备中截取屏幕截图

2.3.4 HoloEverywhere DemoActivity 2.3.4 HoloEverywhere DemoActivity

如果这有用,或者是您的问题的答案,请不要忘记正确标记。

答案 1 :(得分:-1)

  1. 从工作区中删除所有项目;
  2. 导入ActionBarSherlock;
  3. 导入HoloEverywhere;
  4. 导入您的项目;
  5. 确保HoloEverywhere引用ActionBarSherlock并且您的引用HoloEverywhere(您可以通过访问项目属性 - > Android - &gt; Library - &gt; 添加);
  6. 禁用项目 - &gt; 自动构建;
  7. 清理所有项目(请记得取消选中立即开始构建);
  8. 右键单击ActionBarSherlock项目,然后右键单击构建项目;
  9. 分别为HoloEverywhere和你的人做同样的事。
  10. 你必须根据他们的依赖顺序分别建立每个项目。