-1

I have this issue that I could not figure out the reason why. I'm aware that there are many similar question regarding this error in Stack Overflow but I could not find any solution to my problem as I do not have any logcat to the error as the error occured even before I start my app.

My application is running well, but somehow, after restarting the phone, without starting the application, the error "Unfortunately APP_NAME has stopped" appeared. Can anyone tell me what may have been the cause and how can I debug and fix this?

Thanks in advance.

Update : Link to my manifest : 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>

*I could not reveal the entire code as this is for work purposes. And I don't get to decide the content as this is project's requirement. Hope you guys understand.

Anyway, after some debugging, I got this logcat, despite my app runs well.

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
animuson
  • 53,861
  • 28
  • 137
  • 147
Honey H
  • 299
  • 1
  • 6
  • 23

2 Answers2

1

You can use eclipse debug perspective to debug the app using break points, how to is explained in this link Using DDMS + Android Mob for debug

Put the break point in oncreate() then add break points dynamically as u need :)

EDIT: And BOOT_COMPLETE broadcast can be sent using adb shell am command i think, google it for more info. here is the link i got relted to this How To Test BOOT_COMPLETED Broadcast Receiver In Emulator it also works for device i hope.

Community
  • 1
  • 1
Charan Pai
  • 2,288
  • 5
  • 32
  • 44
0
<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" />

So, you want to be able to write to the external storage, mount and unmount the SD card, access to the camera, send SMS, make phone calls, set alarms, read all the user's contacts AND access to the Internet. I can't think of any useful app that can need all those permissions.

May I know which kind of malware are you trying to craft?

Anyway, it may have something to do with the fact that you are using android.permission.RECEIVE_BOOT_COMPLETED, and you haven't set up a proper BroadcastReciever. Allow me to redirect you here.

Community
  • 1
  • 1
Charlie-Blake
  • 10,832
  • 13
  • 55
  • 90
  • it's the project requirement, so I do not get to decide the content. thanks for your reply and I checked out the link. I do have `` in my manifest. except maybe this `` might be the reason why this problem occured. – Honey H Feb 25 '13 at 10:13
  • i dont think you need category.HOME – Charan Pai Feb 25 '13 at 10:57
  • thanks @CharanPai. I removed it. and turned out that I could not access my receiver file due to some naming error in my manifest. – Honey H Feb 26 '13 at 02:23