IntelliJ IDEA: Breakpoint not being hit, and is shown without the tick, just a red dot

后端 未结 10 437
北海茫月
北海茫月 2020-12-29 01:24

First of all, the most similar question that I found is this Intellij IDEA: Breakpoint not being hit, and is shown greyed out but that is not the exact same case.

I

相关标签:
10条回答
  • 2020-12-29 02:03

    I get this same issue intermittently from time to time, I always run the latest version of IDEA. The break points are shown as red but without a tick inside them. Even after I rebuild or re-run in debug they do not get a tick, and they do not "work", i.e., the code continues. I resolve by restarting IDEA, then restarting the debugger/debug run config.

    0 讨论(0)
  • 2020-12-29 02:06

    Android app configuration was the problem for me. I had minifyEnabled true in debug section inside buildTypes in build.gradle file. I had to change it to minifyEnabled false. This change forced me to set multiDexEnabled true as it states in this post Android gives error "Cannot fit requested classes in a single dex file"

    0 讨论(0)
  • 2020-12-29 02:13

    The same happened with me on Mac machine. I followed these steps and all worked fine:

    1. Stop server.
    2. Close all intellij projects.
    3. Open only the specific intellij project on which my application needs to run.
    4. Start the server in debug mode.
    0 讨论(0)
  • 2020-12-29 02:13

    I fixed this by manually deleting all build-related files (for some reason Rebuild did nothing) by running this command at the project's root folder. Note that it does also remove Intellij's temporary configuration files, that are usually not included in git repositories anyway. Replace MODULE with the subfolder containing the module for the project. If you are building an Android app with Android Studio the main module name is usually app.

    rm -rf ./local.properties ./.gradle/ ./.idea/ ./MODULE/build/ ./MODULE/out/
    

    Then restart Intellij with the File -> Invalidate Caches / Restart option, wait for the build and indexing to finish, and debugging should start working again.

    0 讨论(0)
  • 2020-12-29 02:16

    I had the same issue in my mac, tried restarting server, machine, invalidate caches and nothing helped. Then, I noticed when the server is started in debug mode, i didnt see this message: Connected to the target VM, address: '127.0.0.1:64197', transport: 'socket' and I realized that there could be some problem with the server as such.

    Solution: Created new server using command line "./server create " and then associated this server for run configuration. Now started server in debug mode and I saw above message connected to socket port and I am able to see the tick marks on debug point.

    0 讨论(0)
  • 2020-12-29 02:17

    I made a n00b mistake on the IDE. Instead of hitting the debug button, I thought it would work the same as visual studio or eclipse in that I'd have to use the run button, yet when I hit the debug button (That looks like an actual bug) my break-point hit just fine.

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