Can't print(po) through Xcode 14 debugger
Asked Answered
N

0

7

My project was fine until I upgrade my Xcode to Xcode 14, after I upgrade my Xcode a few week, now that every time I try to debug and print it always show error like below and I can't figure it out why:

warning: Swift error in scratch context: error: failed to load module 'UAT'
.
Shared Swift state for UAT.app has developed fatal errors and is being discarded.
REPL definitions and persistent names/types will be lost.

error: expression failed to parse:

I've separate my project target into 4 different targets and the error occurs on every target, I had try to run my project on Xcode 13 and debugger work fine except on Xcode 14, now I can only use print instead of debug console. Does anyone actually ever face this problem like me? Any help would be much appreciate.

Nerte answered 19/10, 2022 at 6:24 Comment(4)
I am seeing the same thing after moving from Xcode 13.4.1 to 14.1. I hope to find a solution soon. If I do, I will post another comment.Tsingyuan
@Tsingyuan I will do the same thing Patrick, thank you very much.Nerte
I believe that I have found a solution for my case. We have an assortment of frameworks that are linked into the application. We have precompiled binaries for each so that team members do not have to build locally unless they choose to. In each Swift framework, I set SWIFT_SERIALIZE_DEBUGGING_OPTIONS to NO for the Release configuration in Xcode. Using the new precompiled binaries, LLDB no longer reports errors. See also: forums.swift.org/t/…Tsingyuan
Thank you very much for the tip Patrick I'll try this solution.Nerte

© 2022 - 2025 — McMap. All rights reserved.