android debugger does not stop at breakpoints

前端 未结 5 1154
心在旅途
心在旅途 2021-02-11 15:06

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

相关标签:
5条回答
  • 2021-02-11 15:48

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

    enter image description here

    0 讨论(0)
  • 2021-02-11 15:51

    Have you set the debuggable flag in the AndroidManifest? If you miss that, do so by adding android:debuggable="true" in the application tag. It should look like that in the end:

    <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">
    
    0 讨论(0)
  • 2021-02-11 15:58

    Solution that worked for me:

    • Simply uninstall the app from the device (manually on the device) and try debugging again(!)
    0 讨论(0)
  • 2021-02-11 16:10

    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

    0 讨论(0)
  • 2021-02-11 16:11

    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.

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