錯誤日誌現有類是java.lang.NoClassDefFoundError在安卓
java.lang.NoClassDefFoundError: com.test.service.SmartManager$BackgroundHandlerThread
at com.test.service.SmartManager.<init>(SmartManager.java:107)
at com.test.service.LiveUSdkService.onCreate(LiveUSdkService.java:82)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2574)
at android.app.ActivityThread.access$1800(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5052)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
at dalvik.system.NativeStart.main(Native Method)
但這類定義爲內部靜態類
我這裏一流
public class SmartManager {
/**
Varibale initialization
**/
static class BackgroundHandlerThread extends HandlerThread {
Handler mHandler = null;
BackgroundHandlerThread() {
super("BackgroundHandlerThread");
start();
mHandler = new Handler(getLooper());
}
void runInBackground(Runnable runnable) {
mHandler.post(runnable);
}
}
public SmartManager() {
/**
............
*/
mThread = new BackgroundHandlerThread(); // Here i got error like this
/**
............
*/
}
/**
Rest of the code
**/
}
當我運行我的應用程序,它會給出這樣的錯誤。但是,類的定義如上所示。但編號不知道爲什麼這樣顯示。
如果使用大量庫和multidex被禁用,則這發生。 –
multidex is enabled –