0

我已经研究了一段时间了,但我遇到了一个我无法弄清楚的错误。我的小部件开始正常并正在更新(我遇到了画布引发回收位图错误的问题)所以我清理了我的项目,现在它无法运行。日志是:

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>
4

3 回答 3

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& AutomaticMode.JavaClass

于 2012-12-21T06:11:01.903 回答
0

android:enable="true"在接收器标签中制作manifest.xml

于 2012-12-21T06:09:57.377 回答
0

检查以确保您package com.radicaldreamgames在顶部有WidgetrisWidget.java.

于 2012-12-21T06:17:38.977 回答