我正在尝试编写dashclock扩展,所以我从example-extension开始, 但我无法让它正常工作。我可以在扩展列表的 dashclock 设置中看到这个示例扩展,但它不在实际的 dashclock 小部件上。它使用此堆栈跟踪定期在后台崩溃:
02-22 17:04:31.118: E/AndroidRuntime(25888): FATAL EXCEPTION: main
02-22 17:04:31.118: E/AndroidRuntime(25888): java.lang.RuntimeException: Unable to instantiate service com.example.dashclock.exampleextension.ExampleExtension: java.lang.ClassNotFoundException: Didn't find class "com.example.dashclock.exampleextension.ExampleExtension" on path: /data/app/com.example.dashclock.exampleextension-1.apk
02-22 17:04:31.118: E/AndroidRuntime(25888): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2513)
02-22 17:04:31.118: E/AndroidRuntime(25888): at android.app.ActivityThread.access$1600(ActivityThread.java:141)
02-22 17:04:31.118: E/AndroidRuntime(25888): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
02-22 17:04:31.118: E/AndroidRuntime(25888): at android.os.Handler.dispatchMessage(Handler.java:99)
02-22 17:04:31.118: E/AndroidRuntime(25888): at android.os.Looper.loop(Looper.java:137)
02-22 17:04:31.118: E/AndroidRuntime(25888): at android.app.ActivityThread.main(ActivityThread.java:5041)
02-22 17:04:31.118: E/AndroidRuntime(25888): at java.lang.reflect.Method.invokeNative(Native Method)
02-22 17:04:31.118: E/AndroidRuntime(25888): at java.lang.reflect.Method.invoke(Method.java:511)
02-22 17:04:31.118: E/AndroidRuntime(25888): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
02-22 17:04:31.118: E/AndroidRuntime(25888): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
02-22 17:04:31.118: E/AndroidRuntime(25888): at dalvik.system.NativeStart.main(Native Method)
02-22 17:04:31.118: E/AndroidRuntime(25888): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.dashclock.exampleextension.ExampleExtension" on path: /data/app/com.example.dashclock.exampleextension-1.apk
02-22 17:04:31.118: E/AndroidRuntime(25888): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
02-22 17:04:31.118: E/AndroidRuntime(25888): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
02-22 17:04:31.118: E/AndroidRuntime(25888): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
02-22 17:04:31.118: E/AndroidRuntime(25888): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2510)
02-22 17:04:31.118: E/AndroidRuntime(25888): ... 10 more
感谢帮助