Actionbarsherlock noClassDefFoundError com.actionb

2019-05-15 06:44发布

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$Styleable at com.actionbarsherlock.internal.ActionbarSherlockCompat.generateLayout(ActionbarSherlockCompat.java 1002)

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!!!

5条回答
Deceive 欺骗
2楼-- · 2019-05-15 07:05

This happened to me after signing the application. The signed apk was returning the above error, while before signing everything worked well. Closing that damn eclipse and starting it again (built in restart option did not work) did the trick for me.

查看更多
一夜七次
3楼-- · 2019-05-15 07:15

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.

查看更多
在下西门庆
4楼-- · 2019-05-15 07:16

I got this Error to when using the SDK Tools Preview 21 and the ADT preview.

Occurred when inflating menu items with actionbarsherlock using. getSupportMenuInflater().inflate(R.menu.search, menu);

Reverting to SDK Tools 20 fixed it.

logcat error:

11-03 09:29:44.738: E/AndroidRuntime(14878): java.lang.NoClassDefFoundError: com.actionbarsherlock.R$styleable
11-03 09:29:44.738: E/AndroidRuntime(14878):    at com.actionbarsherlock.view.MenuInflater$MenuState.readItem(MenuInflater.java:343)
11-03 09:29:44.738: E/AndroidRuntime(14878):    at com.actionbarsherlock.view.MenuInflater.parseMenu(MenuInflater.java:162)
11-03 09:29:44.738: E/AndroidRuntime(14878):    at com.actionbarsherlock.view.MenuInflater.inflate(MenuInflater.java:112)
查看更多
祖国的老花朵
5楼-- · 2019-05-15 07:30

Had the same issue. updating to the latest version of actionbarsherlock and doing a clean all helped me.

查看更多
男人必须洒脱
6楼-- · 2019-05-15 07:30

This issue may caused by ADT version,I solved this issue by using adt-bundle-windows-x86.

查看更多
登录 后发表回答