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

前端 未结 14 861
太阳男子
太阳男子 2020-12-02 07:44

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 tha

相关标签:
14条回答
  • 2020-12-02 08:36

    This worked for me! Change your implicit intent to explicit intent, because starting Oreo implicit intents don't run in background! So basically when creating your Intent object, pass in the class name you want to start. https://developer.android.com/about/versions/oreo/background.html

    0 讨论(0)
  • 2020-12-02 08:36

    I had the same problem with my project. I think it worth pointing out that I could fix this problem magically just by removing some new lines from my code in Eclipse. As an example I changed the following code,

    Intent clickIntent = new Intent(this.getApplicationContext(),
    MyWidgetProvider.class);
    

    to

    Intent clickIntent = new Intent(this.getApplicationContext(),MyWidgetProvider.class);
    
    0 讨论(0)
  • 2020-12-02 08:37

    The "process is bad" is due to multiple crashes of the app (or BroadcastReceiver, Service, or other component). After a few of these the system decides it's fed up with that behavior and prevents the process from starting again.

    A reboot will clear the crash count but it can also be cleared by killing the system server:

    adb shell killall system_server
    

    This will effectively do a "soft reboot." I find it much quicker than an actual reboot.

    0 讨论(0)
  • 2020-12-02 08:38

    i got mine fixed like this:

    uninstall the application and install it again.

    i got this error when i installed a "test" application with the same package name and messed up something in the app cache data or somewhere.

    0 讨论(0)
  • 2020-12-02 08:42

    The problem for me was also had to do with the XML- specifically I had a TextView element that did not specify layout_width and layout_height because they were inheriting a style that did not contain them. My styles.xml file was not validated for this by eclipse. When I ran the app I got the error that these views must be specified- when I fixed the error, I received the process is bad error, and had to Force Quit.

    Unfortunately I think that some settings were maintained, so rebuilding the app was not enough after the fix. I had to uninstall the app-- reboot the phone (to eliminate som persistent data) and when I reinstalled I recovered from the error.

    0 讨论(0)
  • 2020-12-02 08:44

    I hit a process is bad error on my HTC Sensation OS 2.3.4 after removing the INTERNET permission from my AndroidManifest.xml.

    W/ActivityManager( 253): Unable to launch app MY_DOMAIN.flashback/10132 for broadcast Intent { act=android.intent.action.PHONE_STATE flg=0x20000000 (has extras) }: process is bad

    I carefully tried lots of different workarounds, and I found the only way to fix was:

    • Uninstall the app through Settings -> Applications.
    • Remove the battery from the phone (using the Android "Power off" menu did not work).
    • Turn device on again.
    • Install the APK again using adb install <myapp>.

    I want to take this opportunity to list what did NOT work for me (as there seems to a lot of FUD about how to fix this error):

    • Uninstall app, reboot using Android phone menu (press and hold on button and choose "Power off"), turn on again, reinstall.
    • Uninstall, use adb kill-server, then adb start-server, reinstall.
    • Uninstall, run adb shell then ps, this didn't show my app running at all.
    • Uninstall, do a clean build in Eclipse, reinstall.

    I wonder if the underlying problem was caused by my app getting smaller in size. I think it used to unpack to flashback-1.apk and flashback-2.apk on the device, whereas now it is only unpacking to a single flashback-1.apk.

    0 讨论(0)
提交回复
热议问题