skip to Main Content

Shortly after updating to Xcode 13.2.1 I started seeing some weird behaviour of breakpoints. When I run an app (in a simulator) some of my breakpoints change their look and turn to dotted blue outlined. Xcode does not stop execution at these breakpoints although code has been compiled, loaded and executed. I checked it in Console by adding some prints.

When I hover over breakpoint Xcode shows a message:

Xcode won’t pause at this breakpoint because it has not been resolved
Resolving it requires that:

  • The line at the breakpoint is compiled.
  • The compiler generates debug information that is not stripped out (check the Build Settings).
  • The library for the breakpoint is loaded.

All trivial solutions like reloading, reapplying breakpoints have not helped.

Did anybody else see something like this? Is there a way to solve it?

Screenshot for reference:

Xcode screenshot

11

Answers


  1. Chosen as BEST ANSWER

    Ok, so in my particular case rebooting laptop has helped. All breakpoints are now good. But it would still be nice to know the cause of the problem.


  2. In my case the issue was happening, because class was not added to the target, which I was trying to build.

    Login or Signup to reply.
  3. Make sure that the file in which you are adding breakpoint is having correct target set in target membership.

    1. Click on .m file in which you want to add breakpoint.
    2. Select the file inspector.
    3. Check if you have selected correct target for that file or not (check below image).

    enter image description here

    Login or Signup to reply.
  4. If tried everything and nothing worked I suggest the following:

    • Reclone your repo

    This is what worked for me.

    Login or Signup to reply.
  5. I just passed through this problem and the solution for me was recreating the files.

    Note: The ones I was trying to originally breakpoint on were copied from another project. When I created the new files, even though their Identity and Type looked just the same (target membership, encoding, paths), for some reason breakpoints started to work again.

    Note 2: When copying and pasting code to your new files (if done manually), migrated breakpoints – created in the older file – will continue to fail. Only the ones created in this new file will work properly.

    Hope it helps.

    Login or Signup to reply.
  6. For my case somehow the code path was never invoked and very likely considered as dead code. The same thing applies when not adding the file to the target that you want to debug.

    This can be the case or somehow debugger might not be able to resolve your breakpoint. The first thing in this case should be cleaning derived data and any caches.

    But instead of recloning your repo you can just delete breakpoint config from the location described in this answer

    Login or Signup to reply.
  7. For me reboot the Xcode, and it works~

    Login or Signup to reply.
  8. My case

    Working on framework development. Framework is injected into the sample app for development/run purpose. Breakpoints inside the framework won’t work.

    Fix

    Just removing xcframework in sample app and replacing with framework.

    Reason

    xcframework are precompiled outside of the app, so lib isn’t compiled when project is built and that’s why breakpoints doesn’t work.

    Login or Signup to reply.
  9. What worked for me, was to select the files, delete them with – Delete>Move To Trash – and then drag the files back from the trash to the project.

    I edit the answer because I’ve seen that if you have some strange character in the path to the file (some group name for example), the breakpoint is not resolved either.

    I hope it helps

    Login or Signup to reply.
  10. In Xcode 14 the problem is much more prevalent and "consistent". I figured out one pattern where it always fails and how to mitigate it.
    If you have a final class then breakpoints set on or inside a private method will have that issue. If you remove private from the method or final from the class the breakpoints will get resolved properly.

    Login or Signup to reply.
  11. Go to Build Settings, Find Generate Debug Symbol then set to YES

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search