在支持库V7放弃。我是怎么了? [英] Giving up on support library v7. What did I wrong?

查看:96
本文介绍了在支持库V7放弃。我是怎么了?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要添加操作栏中的设备2.3及更高版本。

I need to add the action bar for devices 2.3 and higher.

最近我知道的appcompat V7支持库,这正是这么做的。

I recently knew about the appcompat v7 support library, which does exactly that.

我已经按照href="http://developer.android.com/tool​​s/support-library/setup.html">支持库安装指南的 SDK构建工具V19被破坏的,所以我不得不删除)。两小时后,我仍然无法建立我的项目。我得到这些错误:

I've followed the Support library setup guide, step by step, cleaned, built, and cleaned again, restarted eclipse, upgraded SDK and plugin to the last version (just to realise that SDK build tools v19 are broken, so I had to delete them). Two hours later I'm still unable to build my project. I'm getting these errors:

    [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'.

和我已经竭尽所能了以下问题,但没有成功:
<一href="http://stackoverflow.com/questions/18293088/adding-support-libraries-to-android-project">Adding支持库到Android项目
<一href="http://stackoverflow.com/questions/18563441/after-setting-up-android-support-v7-appcompat-r-java-is-missing">After建立Android的支持-V7-appcompat R.java缺少
<一href="http://stackoverflow.com/questions/18964902/android-support-library-v7-error-retrieving-parent-for-item">Android支持库V7:错误检索父项
<一href="http://stackoverflow.com/questions/17870881/cant-find-theme-appcompat-light-for-new-android-actionbar-support">Can't查找Theme.AppCompat.Light新的Andr​​oid动作条支持
<一href="http://stackoverflow.com/questions/18429951/how-to-resolve-the-error-no-resource-found-that-matches-the-given-name-when-ad">How解决错误[否资源的发现,匹配给定的名称和QUOT;添加库V7 AppCompat当在Eclipse?

And I've tried everything in the following questions, to no avail:
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
Can't Find Theme.AppCompat.Light for New Android ActionBar Support
How to resolve the error "No resource found that matches the given name" when adding library v7 AppCompat in Eclipse?

我并不是说这些答案是无效的,只是由于某种原因,他们并没有为我工作(我想这是因为谷歌恨我)。

I'm not saying those answers are not valid, just that for some reason they didn't work for me (I think it's because Google hates me).

下面是我的清单线为目标SDK:

Here are my manifest lines for the target sdk:

有关库:

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

和为主营项目:

<uses-sdk android:targetSdkVersion="19" android:minSdkVersion="8"/>

尝试各种可能的组合,清洁和建筑在每次更改后,仍然没有运气。

Tried every possible combination, cleaning and building after each change, and still no luck.

看起来这是关系到霍洛的一个问题。我真的不需要霍洛可言,唯一的动作条。现在我只是切换到ActionBarSherlock,这在以往的工作很适合我。但我真的很想知道我做错了,为什么有些事情不工作,尽管我已经花了相当ammount的时间研究这个问题。为什么要在整合图书馆这么多的痛苦,应该是可用的开箱即用的。

Looks like this is a problem related to Holo. I really don't need Holo at all, only ActionBar. For now I'm just switching to ActionBarSherlock, which worked well for me in the past. But I'd really like to know what am I doing wrong, why something does not work despite I've spent a considerable ammount of time researching the issue. Why so much pain in integrating a library that should be usable out of the box.

时有可能得到的支持V7库只行动起来吧?

Is it possible to get ONLY action bar with the support v7 library?

推荐答案

终于得到它的工作。

在添加ActionBarSherlock,同种,其中出现在控制台的错误。

When adding ActionBarSherlock, the same kind of errors where appearing in the console.

我已经编辑了 project.properties 文件(是的,一个与评论这个文件是自动的Andr​​oid工具生成不要修改此文件。 - 您的更改都会被删除) 建设目标定为8,故改为16,现在它用ABS和appcompat V7编译。

I've edited the project.properties file (yeah, that one with the comment "This file is automatically generated by Android Tools. Do not modify this file -- YOUR CHANGES WILL BE ERASED") Build target was set to 8, changed it to 16 and now it compiles with both ABS and appcompat v7.

更新:
以下是如何做到这一点的正确方法: http://stackoverflow.com/a/3343050/813951

UPDATE:
Here's how to do it the right way: http://stackoverflow.com/a/3343050/813951

这篇关于在支持库V7放弃。我是怎么了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆