Actionbarsherlock的NoClassDefFoundError com.actionbarsherlock.R $设置样式样式、NoClassDefFoundError、Actionba

2023-09-06 16:51:32 作者:释然

我迁移我的code使用Actionbarsherlock。我做了所有我需要的code适应与我的项目编译好,没有错误,但我得到了以下异常:

I am migrating my code to use Actionbarsherlock. I have made all the code adaption that I need to and my project compiles fine with no errors, however I get the following exception:

java.lang.NoClassDefFoundError的:com.actionbarsherlock.R $设置样式 在com.actionbarsherlock.internal.ActionbarSherlockCompat.generateLayout(ActionbarSherlockCompat.java 1002)

java.lang.NoClassDefFoundError: com.actionbarsherlock.R$Styleable at com.actionbarsherlock.internal.ActionbarSherlockCompat.generateLayout(ActionbarSherlockCompat.java 1002)

我使用的动作条福尔摩斯的4.1版本。当第一次活动开始,每次我得到这个例外。我已清理和重建项目,检查了我的buildpaths,并不能找到什么是失踪。 Anyhelp将是巨大的!

I am using version 4.1 of actionbar sherlock. I get this exception when the first activity starts every time. I have cleaned and rebuild the project, checked my buildpaths, and can not find what is missing. Anyhelp would be great!!!

推荐答案

如果您使用的是Eclipse的开发环境与ADT插件版本0.9.7或更高版本,您可以包括 ActionBarSherlock 作为库项目。创建使用库/文件夹中现有的源Eclipse的一个新的Andr​​oid项目。然后,在你的项目属性,添加在安卓类别的库部分所创建的项目。

If you’re using the Eclipse Development Environment with the ADT plugin version 0.9.7 or greater you can include ActionBarSherlock as a library project. Create a new Android project in Eclipse using the library/ folder as the existing source. Then, in your project properties, add the created project under the ‘Libraries’ section of the ‘Android’ category.

用户手册剩下的就是这里。

The rest of the user manual is here.