简体   繁体   English

ActionBarSherlock R.未生成

[英]ActionBarSherlock R. is not generating

Today I had a Problem in another Project and the solution was to hit Project -> Clean , but since then the R. in the ActionBarSherlock-library won't generate. 今天,我在另一个项目中遇到了一个问题,解决方案是单击Project -> Clean ,但是从那以后,不会生成ActionBarSherlock库中的R。 I couldn't solve this problem so I restarted eclipse and downloaded and imported the library again. 我无法解决此问题,因此我重新启动了eclipse并再次下载并导入了该库。 But the error is still there. 但是错误仍然存​​在。 The Problem is that there is no red flag in my res folder. 问题是我的res文件夹中没有红色标记。 If I open the Error-Log I can see a bunch of warnings and errors, but this one is being repeated very much: 如果打开错误日志,我会看到一堆警告和错误,但是这一警告正在被重复很多次:

abs__action_menu_layout.xml: Failed to convert ?attr/actionBarDivider into a drawable
abs__action_menu_item_layout.xml: Couldn't find theme resource attr/actionButtonStyle for the current theme

I have the newest version of actionbarsherlock, so I doubt the resource is actually missing. 我拥有最新版本的actionbarsherlock,因此我怀疑资源实际上是否缺失。 Any ideas? 有任何想法吗?

I have often had this problem where the R.java file will not generate. 我经常遇到无法生成R.java文件的问题。 It occurs when there is a problem with one/many of your resources (Images/Sounds/Layouts etc). 当您的一个/许多资源(图像/声音/布局等)出现问题时,就会发生这种情况。

It appears that you have errors in both the XML files mentioned. 似乎在提到的两个XML文件中都有错误。 It looks like actionBarDivider and actionButtonStyle are not missing/not generated. 它看起来像actionBarDivideractionButtonStyle不缺少/不产生。 I would look at the definitions for both of those and see if there are any issues. 我将看看这两个的定义,看看是否有任何问题。

Try to remove the libs folder and then click on the library project Android Tools->Add Support Library. 尝试删除libs文件夹,然后单击库项目“ Android工具”->“添加支持库”。 After that make Project->Clean... 之后,执行Project-> Clean ...

If this doesn't help, try to download the fresh version of abs from officail web-site and re-add it to your project. 如果这样做没有帮助,请尝试从officail网站下载Abs的新版本,然后将其重新添加到您的项目中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM