Error when debugging: Cannot create Swift scratch context
thanks a lot, appreciate the fix!
I cannot debug ui tests now and it seems I will have to revert back to beta2?
Few things important to note:
I'm on Catalina 10.15.7 (same issue was on 10.15.6).
Initially this issue appeared in Xcode 12.0.1, but not after I updated to it. I can swear it was working just fine until at some point it suddenly stopped working (no updates happened in between).
It has nothing to do with the project I'm running. I tried fresh new iOS and macOS projects, same issue everywhere.
I downloaded Xcode 12.2 beta 2 and the same problems happens there
I also submitted a ticket via Feedback Assistant: FB8790427
Get the "Cannot create Swift scratch context (couldn't create a ClangImporter)" error whenever a breakpoint is triggered, and po/v/p don't return anything. When using the built-in inspector, I get "expression produced no result".
Does anyone have any ideas at all? I'm the only one on my team dealing with this.
Investigating this? Or experiencing this?I'm the only one on my team dealing with this.
If you’re the only one experiencing the problem, it’s time for some differential debugging…
If you and a colleague check out exactly the same code and build it with exactly the same Xcode on exactly same version of macOS, do you see different behaviour? That is, things work for them and don’t work for you?
If so, there’s something about your environment that’s triggering the problem. In that case you should try creating a new user account on your Mac to see if the problem follows that.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
I did create a new user, and saw success in getting debugging to work properly. However, I'm unsure of what actually is different between the two user accounts. Making a permanent switch to another user account would be too difficult at this point, as well.
I've tried uninstalling Xcode, and clearing out/deleting all Xcode related folders I can find on the broken user account.
Also, Xcode 11 continues to work perfectly. This only occurs on any version of Xcode 12 (all betas have had this problem for me)
That’s great news.I did create a new user, and saw success in getting debugging to work
properly.
Indeed, and that’s not what I’m proposing. Rather, this is a diagnostic test which shows that there’s some sort of state in your user account that’s triggering this problem. Now you just have to figure out what it is (-:Making a permanent switch to another user account would be too
difficult at this point, as well.
Unfortunately I don’t have any obvious suggestions for where to look, but here’s another thing you can try:
Create a new user account.
Log in.
Take a snapshot of the files in that user account’s home directly, for example, by running find ~.
Set up Xcode and run your test.
Redo the snapshot as per step 3.
Compare the two snapshots. This should give you a list of files that Xcode touched while building your project. You can take this knowledge back to your main account and go on a deleting spree (-:
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"