我一直在努力工作一段时间,我遇到了一个我无法弄清楚的错误。我的小部件开始很好并且更新(我有一个问题,画布抛出recyclebitmap错误)所以我清理了我的项目,现在它不会运行。 logcat是:
12-21 00:49:18.967: E/AndroidRuntime(4967): FATAL EXCEPTION: main
12-21 00:49:18.967: E/AndroidRuntime(4967): java.lang.RuntimeException: Unable to instantiate receiver com.radicaldreamgames.WidgetrisWidget: java.lang.ClassNotFoundException: com.radicaldreamgames.WidgetrisWidget
12-21 00:49:18.967: E/AndroidRuntime(4967): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2202)
12-21 00:49:18.967: E/AndroidRuntime(4967): at android.app.ActivityThread.access$1500(ActivityThread.java:134)
12-21 00:49:18.967: E/AndroidRuntime(4967): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283)
12-21 00:49:18.967: E/AndroidRuntime(4967): at android.os.Handler.dispatchMessage(Handler.java:99)
12-21 00:49:18.967: E/AndroidRuntime(4967): at android.os.Looper.loop(Looper.java:137)
12-21 00:49:18.967: E/AndroidRuntime(4967): at android.app.ActivityThread.main(ActivityThread.java:4697)
12-21 00:49:18.967: E/AndroidRuntime(4967): at java.lang.reflect.Method.invokeNative(Native Method)
12-21 00:49:18.967: E/AndroidRuntime(4967): at java.lang.reflect.Method.invoke(Method.java:511)
12-21 00:49:18.967: E/AndroidRuntime(4967): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
12-21 00:49:18.967: E/AndroidRuntime(4967): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
12-21 00:49:18.967: E/AndroidRuntime(4967): at dalvik.system.NativeStart.main(Native Method)
12-21 00:49:18.967: E/AndroidRuntime(4967): Caused by: java.lang.ClassNotFoundException: com.radicaldreamgames.WidgetrisWidget
12-21 00:49:18.967: E/AndroidRuntime(4967): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
12-21 00:49:18.967: E/AndroidRuntime(4967): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
12-21 00:49:18.967: E/AndroidRuntime(4967): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
12-21 00:49:18.967: E/AndroidRuntime(4967): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2197)
12-21 00:49:18.967: E/AndroidRuntime(4967): ... 10 more
这是清单:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.radicaldreamgames.widgetris"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
-
<activity
android:name="StartActivity"
android:theme="@android:style/Theme.NoDisplay" >
-
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".ButtonServices"
android:enabled="true" />
-
<receiver
android:name="com.radicaldreamgames.WidgetrisWidget"
android:label="@string/app_name"
android:enabled="true" >
-
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widgetris_widget_provider" />
</receiver>
</application>
</manifest>
答案 0 :(得分:1)
<activity
android:name=".StartActivity"
android:theme="@android:style/Theme.NoDisplay" >
接收者应该: -
<receiver
android:name="com.msg2email.automatic.AutomaticMode"
android:process=":remote" />
com.msg2email.automatic是Package
&amp; AutomaticMode.Java Class
答案 1 :(得分:0)
请在android:enable="true"
manifest.xml
答案 2 :(得分:0)
检查以确保package com.radicaldreamgames
顶部有WidgetrisWidget.java
。