找不到符合给定名称“Theme.AppCompat.Light.DarkActionBar”的资源 [英] No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'
问题描述
我已经向项目浏览器添加了 android-support-v7-appcompat
和 appcompat_v7
。并且还将 android-support-v7-appcompat.jar
添加到构建路径。
I have added android-support-v7-appcompat
and appcompat_v7
to the project explorer. And also added the android-support-v7-appcompat.jar
to the build path.
但是,得到这个
No resource found - Theme.AppCompat.Light.DarkActionBar!
如何解决这个问题?
推荐答案
对于我来说,解决方案是重新创建Android的v7应用程序兼容性(appcompat)支持库:
For me the solution involved recreating Android's v7 application compatibility (appcompat) support library:
- 创建新的<$ c $根据 android-support-v7-appcompat 开发者支持库设置页面上的>说明。 注意: 我不得不手动将
project.properties
获取新库进行编译。更改target = android-19
totarget = android-21
。 - 明确地将这个新的
android-support-v7-appcompat
库添加到烦恼的项目中:
- 完成后,项目的属性应如下所示:
- Create the new
android-support-v7-appcompat
library according to the instructions on the Android developer Support Library Setup page. Note: I had to manually change theproject.properties
file to get the new library to compile. Changetarget=android-19
totarget=android-21
. - Explicitly add this new
android-support-v7-appcompat
library to your troubled project: - After that's done the project's properties should look something like this:
现在,项目应该编译。这还有很长的路要走,但是对我来说也是如此。
Now, the project should compile. It's a long way to go, but it worked for me.
所有这些工作的一个有趣的副作用是,当我创建我的下一个项目时,Eclipse自动创建一个新的 appcompat_v7
库项目,将其添加到我的工作区,突然一切都恢复正常。我可能做了不同的事情,但是我根本无法弄明白什么。无论如何,我终于让我的项目进行编译,在这个过程中,我看到我在Eclipse ADT中重置了一些东西。
An interesting side effect of all of this work is that when I created my next project, Eclipse automatically created a new appcompat_v7
library project, added it to my workspace, and suddenly everything was back to normal. I probably did something different, but I just haven't been able to figure it out what yet. Anyway, I finally got my project to compile and in the process it appears that I reset something in the Eclipse ADT.
我希望这有助于。
这篇关于找不到符合给定名称“Theme.AppCompat.Light.DarkActionBar”的资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!