Unfortunately, MyApp has stopped - no error logs in logcat

蹲街弑〆低调 提交于 2019-12-22 04:35:06

问题


Every once in a while I get:

Unfortunately, MyApp has stopped.

Problem is easy to solve if you have some logs, but in my case logcat has absolutely no message of error (it has normal messages published by my app and other exceptions are shown there but not this one which causes this app has stopped).

Is there any chance I can solve this problem?

The good thing is I can quite easily reproduce it, thus I'm trying to put as many information I can to logcat and then investigate what happened.

I have ACRA up and running (other exceptions are caught by it but not this app has stopped).

When it happens my app is not visible and there are some things happendnig in IntentService. My app is tracking geofences and the app has stopped happens only on HTC M8 when I switch on and off Location in phone Settings. I've tested on different phones and it does not happen on LG G3, Nexus 5, Moto G, LG Swift L9.


回答1:


  • Did you try to run LogCat in command-line? You might be able to see the error. Android LogCat in command-line
  • If your using Eclipse as IDE, try checking your filters for LogCat. You may accidently not displaying errors in LogCat.
  • Try finding the error via the Debugger. Place breakpoints to places where you suggest the error to be.



回答2:


It sounds quite trivially - try to restart computer, test at other emulator or device. Also you can add your try-catch block and forget to type e.printStackTrace() or use UncaughtExceptionHandler.




回答3:


In my case logcat was filtered. You can change filter in Android Monitor -> logcat -> Bottom right corner, change filter to No Filters. It will show all errors.




回答4:


It's very weird,that you are not able to find out any logcat. So why don't you try Hockey app.Please go through the guide.I think you can use it for some time.After that you have to pay for it.

Good Luck.



来源:https://stackoverflow.com/questions/32455645/unfortunately-myapp-has-stopped-no-error-logs-in-logcat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!