Xcode won't pause at this breakpoint because it has not been resolved

12.5k views Asked by At

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

14

There are 14 answers

0
phantom_2 On

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

1
Artem Kirillov On

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.

1
pallavi On

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

0
Konstantinos Nikoloutsos On

If tried everything and nothing worked I suggest the following:

  • Reclone your repo

This is what worked for me.

0
qwerty On

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

0
Young On

For me reboot the Xcode, and it works~

0
nja On

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.

0
gabrielrf97 On

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.

1
Zhou Haibo On

I have the same problem when using iOS Simulator (iOS 16.1). And when I change to iOS 17.2, the issue is solved.

2
Moataz_Akram On

Conclusion:

changing simulator fixed it for my case

Details:

I want to clarify my case and then what fixed the issue for me.

I had to update to Xcode 15.1 then breakpoints stopped working for no reason, I tried all possible solutions I found but none worked, for example (restarting xcode, deleting derived data, removing all points adding them again, checked all debugging configurations, etc..)

usually before updating to Xcode 15.1 (then 15.2 trying to fix the issue but didn't work), I was developing using simulators iPhone12 (iOS 15) & iPhone s6 (iOS 15), at both the break points didn't work so I never thought the simulator is the reason, however in a disparate trial, I tried to run on iPhone 15(iOS 17.2 -> the default simulator with the Xcode version) and it worked just fine!!!

0
Lihour On

In my case I clear Xcode junk files then breakpoint not work. Here is what I have do:

  • Delete old iOS simulator version (iOS 16.4) (current one) -> download new one from Xcode ide

** What I have test is if u keep track breakpoint on old iOS version it won't work but it will work on new download iOS version.

0
JCA On

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

0
Vadim Dagman On

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.

1
Aika Melanie Dionisio On

Go to Build Settings, Find Generate Debug Symbol then set to YES