找不到与给定名称' Theme.AppCompat.Light.DarkActionBar'匹配的资源. [英] No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'

查看:77
本文介绍了找不到与给定名称' 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:

  1. 根据android-support-v7-appcompat 库Android开发者支持库设置页面上的="nofollow noreferrer">说明. 注意: 我必须手动更改 project.properties 文件,以编译新库.将 target = android-19 更改为 target = android-21 .
  2. 将这个新的 android-support-v7-appcompat 库明确添加到遇到问题的项目中:
  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天全站免登陆