使用ActionbarSherlock时的NoClassDefFoundError

时间:2013-05-25 16:32:04

标签: java android actionbarsherlock noclassdeffounderror

我试图调试这个,但无法弄清楚它为什么不起作用。

这是logcat输出:

05-25 17:28:39.251: E/AndroidRuntime(1008): FATAL EXCEPTION: main
05-25 17:28:39.251: E/AndroidRuntime(1008): java.lang.NoClassDefFoundError: com.actionbarsherlock.widget.SuggestionsAdapter
05-25 17:28:39.251: E/AndroidRuntime(1008):     at com.actionbarsherlock.widget.SearchView.updateSearchAutoComplete(SearchView.java:1132)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at com.actionbarsherlock.widget.SearchView.setSearchableInfo(SearchView.java:370)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at com.liamwli.spotify.spotifycommunity.MainActivity.onCreateOptionsMenu(MainActivity.java:153)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at com.actionbarsherlock.app.SherlockActivity.onCreatePanelMenu(SherlockActivity.java:184)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at com.actionbarsherlock.ActionBarSherlock.callbackCreateOptionsMenu(ActionBarSherlock.java:559)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at com.actionbarsherlock.internal.ActionBarSherlockNative.dispatchCreateOptionsMenu(ActionBarSherlockNative.java:65)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at com.actionbarsherlock.app.SherlockActivity.onCreateOptionsMenu(SherlockActivity.java:149)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at android.app.Activity.onCreatePanelMenu(Activity.java:2498)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:407)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at com.android.internal.policy.impl.PhoneWindow.doInvalidatePanelMenu(PhoneWindow.java:769)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at com.android.internal.policy.impl.PhoneWindow$1.run(PhoneWindow.java:201)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at android.view.Choreographer.doCallbacks(Choreographer.java:562)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at android.view.Choreographer.doFrame(Choreographer.java:531)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at android.os.Handler.handleCallback(Handler.java:725)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at android.os.Handler.dispatchMessage(Handler.java:92)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at android.os.Looper.loop(Looper.java:137)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at android.app.ActivityThread.main(ActivityThread.java:5229)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at java.lang.reflect.Method.invokeNative(Native Method)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at java.lang.reflect.Method.invoke(Method.java:525)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:799)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
05-25 17:28:39.251: E/AndroidRuntime(1008):     at dalvik.system.NativeStart.main(Native Method)

我试过禁用proguard,如果是问题,但没有运气。

班上的第153行是:

searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));

有人可以协助解决这个问题吗?

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

更新支持库和工具包,然后删除libs文件夹中的支持库jar文件,为我修复了这个问题。