android debugger does not stop at breakpoints

2020-07-01 04:30发布

I am seeing debug statements in the console but the debugger does not stop on any breakpoints. I tried clearing all breakpoints and adding them back in. Not sure how this can happen but it is.

10条回答
家丑人穷心不美
2楼-- · 2020-07-01 04:45

According to this answer, Inside build.gradle for your app module, disable minifyEnable for your build variant and change it to false. Then, it should be:

minifyEnabled false

othewise you will see Line number not available in class xxxx when you hover over breakpoint markers and they will be looked with a cross on them

查看更多
欢心
3楼-- · 2020-07-01 04:46

Solution that worked for me:

  • Simply uninstall the app from the device (manually on the device) and try debugging again(!)
查看更多
贪生不怕死
4楼-- · 2020-07-01 04:47

Did you do "Debug As --> Android Application" instead of "Run As"?

Only if you do "Debug As", eclipse will stop at breakpoints.

查看更多
Explosion°爆炸
5楼-- · 2020-07-01 04:59

If you use Android studio, click debug app instead of run app:

enter image description here

查看更多
神经病院院长
6楼-- · 2020-07-01 05:00

I had the same issue and resolved it by increasing the debugger timeout values. The emulator is slow as a dog on my Dev box and that is what prevented the debugger to catch and stop on breakpoints. I changed the timeout values respectively from 3000 to 10000 and 20000 to 60000 and all is fine now.

V.

查看更多
▲ chillily
7楼-- · 2020-07-01 05:02

In my case, click the "Attach debugger to Android process"

And it will shows a window said "Choose Process" Select the device you are using, and select the project that you want to debug. And it works.

Sometimes the debugger need to re-attach to the devices when you open the debugger at the first time.

查看更多
登录 后发表回答