如果Debugging,Android无响应。如果没有在调试应用程序正常工作 [英] Android not responding if Debugging. If not in Debug app works normally

查看:300
本文介绍了如果Debugging,Android无响应。如果没有在调试应用程序正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我调试和应用程序击中断点时,我可以正常调试一段时间。一段时间后,Android会显示ANR Dialog,但是我仍然可以正常调试。

When I'm debugging and the app hits an breakpoint, I can debug normally for a while. Some time later, Android displays the ANR Dialog, but I still can debug normally.

如果我没有点击手机的屏幕,它会结束调试,所以我需要在调试时保持眼睛在屏幕上,这很烦人,真的浪费了我时间,因为有时每隔10秒钟会弹出对话框。

If I don't click on the Phone's screen, it ends the debug, so I need to keep my eye on the screen when debugging and that's annoying and really wastes my time, because sometimes the dialog keeps popping every 10 seconds.

我不知道是什么原因造成的。我尝试重新启动机器,手机,ADB,并已经尝试在AndroidManifest上使用debuggable =true,没有成功。

I don't know what is causing this. I tried restarting the Machine, Phone, ADB and already tried using debuggable="true" on AndroidManifest, with no success.

推荐答案

看起来问题是在后台运行的服务。

Looks like the problem is with a service running in background.

我的服务每5分钟执行一次后台任务,所以如果断点暂停主线程,服务会尝试运行并显示不响应弹出窗口。十秒钟后,如果我们仍然处于断点状态,系统会再次显示烦人的弹出窗口。

My service executes a background task every 5 minutes, so if the breakpoint "pauses" the main thread, the service tries to run and show the Not Responding popup. Ten seconds later, if we are still in the breakpoint, the system shows that annoying popup over and over again.

只是为了清楚,我的服务没有问题,看起来像是IntelliJ IDEA调试的方式。当我需要调试大的东西时,我禁用该服务进行调试,弹出窗口没有出现。

Just to be clear, there is no problem with my service, looks like it is the way IntelliJ IDEA debugs. When i need to debug something big, I disable the Service for the debug and the popup did not appear.

我不知道有没有办法让IDE知道它没有响应,因为我们正在调试主线程,因为应该是正确的解决方案。

I don't know if there is a way to make the IDE aware that it is not responding because we are debugging the main Thread, cause that should be the right solution.

这篇关于如果Debugging,Android无响应。如果没有在调试应用程序正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆