我有这个问题,我无法弄清楚原因。我知道 Stack Overflow 中有很多关于此错误的类似问题,但我找不到任何解决我的问题的方法,因为我没有任何 logcat 错误,因为即使在我启动我的应用程序之前就发生了错误。
我的应用程序运行良好,但不知何故,重新启动手机后,没有启动应用程序,出现错误“不幸的是 APP_NAME 已停止”。谁能告诉我可能是什么原因,我该如何调试和解决这个问题?
提前致谢。
更新: 链接到我的清单:http ://pastie.org/pastes/6332771/text?key=ay9snpcgwce9cgoxsl5tzg
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test.honey"
android:versionCode="1"
android:versionName="1" >
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="17" />
<permission android:name="com.test.honey.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.com.test.honey.permission.C2D_MESSAGE" />
<!-- App receives GCM messages. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"></uses-permission>
<uses-permission android:name="android.permission.CAMERA"></uses-permission>
<uses-permission android:name="android.permission.CALL_PHONE"></uses-permission>
<uses-permission android:name="android.permission.READ_CONTACTS"></uses-permission>
<uses-permission android:name="android.permission.SEND_SMS"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.READ_FRAME_BUFFER"/>
<uses-permission android:name="android.permission.SET_ALARM" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<!-- App receives GCM messages. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<application
android:icon="@drawable/mj_icon"
android:label="@string/app_name"
android:theme="@android:style/Theme.Light.NoTitleBar"
android:largeHeap="true">
<uses-library android:name="com.google.android.maps" />
<activity android:name="com.test.honey.Splash" android:label="@string/app_name" android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!--ACTIVITIES HERE-->
<receiver android:name="com.test.honey.MyReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</receiver>
<receiver android:name="test.honey.AlertReceiver" />
<receiver android:name="test.honey.SchedulerReceiver" />
<provider android:name="test.honey.database.DataProvider1" android:authorities="test.mycare1" />
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!-- Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<!-- Receives the registration id. -->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.test.honey" />
</intent-filter>
</receiver>
<service android:name=".GCMIntentService" />
</application>
</manifest>
*我无法透露整个代码,因为这是出于工作目的。而且我无法决定内容,因为这是项目的要求。希望大家理解。
无论如何,经过一些调试,我得到了这个 logcat,尽管我的应用程序运行良好。
java.lang.RuntimeException: Unable to instantiate receiver
com.test.honey.MyCareStartupReceiver:
java.lang.ClassNotFoundException:
com.fireworks.momsapp.MyCareStartupReceiver
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2251)
at android.app.ActivityThread.access$1500(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4898)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1008)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:775)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException:
com.test.honey.MyCareStartupReceiver
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2246)
... 10 more