The application has stopped unexpectedly: How to Debug?

后端 未结 5 2375
春和景丽
春和景丽 2020-12-23 17:36

Please note, unlike many other questions having the subject title \"application has stopped unexpectedly\", I am not asking for troubleshooting a particular problem.

相关标签:
5条回答
  • 2020-12-23 17:56

    If you use the Logcat display inside the 'debug' perspective in Eclipse the lines are colour-coded. It's pretty easy to find what made your app crash because it's usually in red.

    The Java (or Dalvik) virtual machine should never crash, but if your program throws an exception and does not catch it the VM will terminate your program, which is the 'crash' you are seeing.

    0 讨论(0)
  • 2020-12-23 18:06

    Filter your log to just Error and look for FATAL EXCEPTION

    0 讨论(0)
  • 2020-12-23 18:06

    Check whether your app has the needed permissions.I was also getting the same error and I checked the logcat debug log which showed this:

    04-15 13:38:25.387: E/AndroidRuntime(694): java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel:555-555-5555 cmp=com.android.phone/.OutgoingCallBroadcaster } from ProcessRecord{44068640 694:rahulserver.test/10055} (pid=694, uid=10055) requires android.permission.CALL_PHONE
    

    I then gave the needed permission in my android-manifest which worked for me.

    0 讨论(0)
  • 2020-12-23 18:14
    1. From the Home screen, press the Menu key.
    2. List item
    3. Touch Settings.
    4. Touch Applications.
    5. Touch Manage Applications.
    6. Touch All.
    7. Select the application that is having issues.
    8. Touch Clear data and Clear cache if they are available. This resets the app as if it was new, and may delete personal data stored in the app.
    0 讨论(0)
  • 2020-12-23 18:19

    I'm an Eclipse/Android beginner as well, but hopefully my simple debugging process can help...

    You set breakpoints in Eclipse by right-clicking next to the line you want to break at and selecting "Toggle Breakpoint". From there you'll want to select "Debug" rather than the standard "Run", which will allow you to step through and so on. Use the filters provided by LogCat (referenced in your tutorial) so you can target the messages you want rather than wading through all the output. That will (hopefully) go a long way in helping you make sense of your errors.

    As for other good tutorials, I was searching around for a few myself, but didn't manage to find any gems yet.

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