0

小部件工作正常,但主要活动 FC 的。

日志如下:

04-22 14:13:58.045: D/AndroidRuntime(2479): Shutting down VM
04-22 14:13:58.045: W/dalvikvm(2479): threadid=1: thread exiting with uncaught exception (group=0x40018560)
04-22 14:13:58.065: E/AndroidRuntime(2479): FATAL EXCEPTION: main
04-22 14:13:58.065: E/AndroidRuntime(2479): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.liamwli.reboot_widget/com.liamwli.reboot_widget.RebootwidgetActivity}: java.lang.ClassNotFoundException: com.liamwli.reboot_widget.RebootwidgetActivity in loader dalvik.system.PathClassLoader[/data/app/com.liamwli.reboot_widget-2.apk]
04-22 14:13:58.065: E/AndroidRuntime(2479):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1680)
04-22 14:13:58.065: E/AndroidRuntime(2479):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784)
04-22 14:13:58.065: E/AndroidRuntime(2479):     at android.app.ActivityThread.access$1500(ActivityThread.java:123)
04-22 14:13:58.065: E/AndroidRuntime(2479):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939)
04-22 14:13:58.065: E/AndroidRuntime(2479):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-22 14:13:58.065: E/AndroidRuntime(2479):     at android.os.Looper.loop(Looper.java:130)
04-22 14:13:58.065: E/AndroidRuntime(2479):     at android.app.ActivityThread.main(ActivityThread.java:3835)
04-22 14:13:58.065: E/AndroidRuntime(2479):     at java.lang.reflect.Method.invokeNative(Native Method)
04-22 14:13:58.065: E/AndroidRuntime(2479):     at java.lang.reflect.Method.invoke(Method.java:507)
04-22 14:13:58.065: E/AndroidRuntime(2479):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
04-22 14:13:58.065: E/AndroidRuntime(2479):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
04-22 14:13:58.065: E/AndroidRuntime(2479):     at dalvik.system.NativeStart.main(Native Method)
04-22 14:13:58.065: E/AndroidRuntime(2479): Caused by: java.lang.ClassNotFoundException: com.liamwli.reboot_widget.RebootwidgetActivity in loader dalvik.system.PathClassLoader[/data/app/com.liamwli.reboot_widget-2.apk]
04-22 14:13:58.065: E/AndroidRuntime(2479):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
04-22 14:13:58.065: E/AndroidRuntime(2479):     at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
04-22 14:13:58.065: E/AndroidRuntime(2479):     at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
04-22 14:13:58.065: E/AndroidRuntime(2479):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
04-22 14:13:58.065: E/AndroidRuntime(2479):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1672)
04-22 14:13:58.065: E/AndroidRuntime(2479):     ... 11 more

我是android应用程序开发的新手,不知道问题是什么:(

4

1 回答 1

2

Android 正在寻找一个名为的类com.liamwli.reboot_widget.RebootwidgetActivity,但找不到它。确保所有内容都拼写正确,包括大小写。

我还建议您去掉包名称中的下划线,因为这可能会导致您出现问题。Java 包通常是字母、数字和点。

于 2012-04-22T13:55:08.340 回答