没有资源的发现,给定的名称匹配'Theme.AppCompat.Light.DarkActionBar“ [英] No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'

查看:503
本文介绍了没有资源的发现,给定的名称匹配'Theme.AppCompat.Light.DarkActionBar“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经加入 Android的支持-V7-应用程序兼容性 appcompat_v7 来的项目资源管理器。而且还增加了 Android的支持-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应用程序兼容性(程序兼容性)支持库:

For me the solution involved recreating Android's v7 application compatibility (appcompat) support library:


  1. 根据的 Android的支持-V7-应用程序兼容性库https://developer.android.com/tool​​s/support-library /setup.html\">instructions 的Andr​​oid开发支持库设置页上。 注: 我不得不手动更改 project.properties 文件拿到新库进行编译。更改目标=机器人-19 目标= Android的21

  2. 明确这个新的 Android的支持-V7-应用程序兼容性库添加到您问题的项目:


  3. 之后的完成项目的属性应该是这个样子:

  1. 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 the project.properties file to get the new library to compile. Change target=android-19 to target=android-21.
  2. Explicitly add this new android-support-v7-appcompat library to your troubled project:
  3. 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屋!

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