0

我收到了来自LogCat

        dalvikvm(526): Could not find class 'com.temp.pt.database.DBHelper',
 referenced from method com.temp.pt.database.DBUtils.getDBHelper

之后我有了这个

05-11 21:46:25.305: E/AndroidRuntime(526): FATAL EXCEPTION: main
05-11 21:46:25.305: E/AndroidRuntime(526): java.lang.NoClassDefFoundError: com.temp.pt.database.DBHelper
05-11 21:46:25.305: E/AndroidRuntime(526):  at com.temp.pt.database.DBUtils.getDBHelper(DBUtils.java:20)
05-11 21:46:25.305: E/AndroidRuntime(526):  at com.temp.pt.CategoriesFragment$CategoryAsyncLoader.<init>(CategoriesFragment.java:169)
05-11 21:46:25.305: E/AndroidRuntime(526):  at com.temp.pt.CategoriesFragment.onCreateLoader(CategoriesFragment.java:76)
05-11 21:46:25.305: E/AndroidRuntime(526):  at android.support.v4.app.LoaderManagerImpl.createLoader(LoaderManager.java:486)
05-11 21:46:25.305: E/AndroidRuntime(526):  at android.support.v4.app.LoaderManagerImpl.createAndInstallLoader(LoaderManager.java:495)
05-11 21:46:25.305: E/AndroidRuntime(526):  at android.support.v4.app.LoaderManagerImpl.initLoader(LoaderManager.java:549)
05-11 21:46:25.305: E/AndroidRuntime(526):  at com.temp.pt.CategoriesFragment.onActivityCreated(CategoriesFragment.java:45)
05-11 21:46:25.305: E/AndroidRuntime(526):  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:891)
05-11 21:46:25.305: E/AndroidRuntime(526):  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1080)
05-11 21:46:25.305: E/AndroidRuntime(526):  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
05-11 21:46:25.305: E/AndroidRuntime(526):  at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:1810)
05-11 21:46:25.305: E/AndroidRuntime(526):  at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:501)
05-11 21:46:25.305: E/AndroidRuntime(526):  at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1133)
05-11 21:46:25.305: E/AndroidRuntime(526):  at android.app.Activity.performStart(Activity.java:4475)
05-11 21:46:25.305: E/AndroidRuntime(526):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1929)
05-11 21:46:25.305: E/AndroidRuntime(526):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
05-11 21:46:25.305: E/AndroidRuntime(526):  at android.app.ActivityThread.access$600(ActivityThread.java:123)
05-11 21:46:25.305: E/AndroidRuntime(526):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
05-11 21:46:25.305: E/AndroidRuntime(526):  at android.os.Handler.dispatchMessage(Handler.java:99)
05-11 21:46:25.305: E/AndroidRuntime(526):  at android.os.Looper.loop(Looper.java:137)
05-11 21:46:25.305: E/AndroidRuntime(526):  at android.app.ActivityThread.main(ActivityThread.java:4424)
05-11 21:46:25.305: E/AndroidRuntime(526):  at java.lang.reflect.Method.invokeNative(Native Method)
05-11 21:46:25.305: E/AndroidRuntime(526):  at java.lang.reflect.Method.invoke(Method.java:511)
05-11 21:46:25.305: E/AndroidRuntime(526):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-11 21:46:25.305: E/AndroidRuntime(526):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-11 21:46:25.305: E/AndroidRuntime(526):  at dalvik.system.NativeStart.main(Native Method)

注意我已经定义了类并且应用程序编译没有错误但在运行时崩溃。有什么建议,这个问题的解决方案?

4

0 回答 0