Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "process is bad" error for an Android Widget?

I have developed an Android Widget, and it was working fine. I added some extra functionality and pushed an update through the Android Market. Now people are complaining that it doesn't work anymore.

The error I see in the logs is:

07-14 10:33:44.016: WARN/ActivityManager(78): Unable to launch app ...  for broadcast Intent { act=android.appwidget.action.APPWIDGET_ENABLED  cmp=... }: process is bad  07-14 10:33:44.026: WARN/ActivityManager(78): finishReceiver called  but none active  07-14 10:33:44.026: WARN/ActivityManager(78): Unable to launch app ...  for broadcast Intent { act=android.appwidget.action.APPWIDGET_UPDATE  cmp=... (has extras) }: process is bad  07-14 10:33:44.036: WARN/ActivityManager(78): finishReceiver called  but none active  

I have searched, but I cannot find anywhere what the process is bad error means, so I have no clue on how to fix it. Restarting the phone (or emulator) makes the error go away, however, that is not what I want my users to do. Could someone please help me to explain what the cause of the error is and how to fix it?

like image 846
wligtenberg Avatar asked Jul 15 '10 08:07

wligtenberg


2 Answers

Happened to me when my BroadcastReceiver was repeatedly leaking an exception causing the system to kill my app. The next calls to the receiver would result in the "process is bad" logs.

The solution in my case was making sure no exceptions leak from the BroadcastReceiver.

Those are the logs when the app is killed (try looking for them and finding the cause):

W/ActivityManager﹕ Process com.company.app has crashed too many times: killing! I/ActivityManager﹕ Killing proc 9344:com.company.app/u0a10239: crash 
like image 74
Victor Basso Avatar answered Oct 16 '22 13:10

Victor Basso


I am having the same problem and my current theory is that the appWidget crashed and when it was restarted it had the same bad persistent data that made it crash each time it was restarted. When this happens too often, the appWidget is "force stopped" by the OS. My band aid is to have a touch event that is "setOnClickPending" that the user will touch (out of frustration if necessary) and that will be processed internal to the appWidget and reset the appWidget.

like image 44
mobibob Avatar answered Oct 16 '22 13:10

mobibob