Xcode 11 debugger crashes on breakpoint, can't find Foundation.h

My macOS app compiles and runs fine, but since switching to Xcode 11, I can no longer debug from breakpoints. The debugger always crashes with a bunch of messages like this:


warning: Swift error in scratch context: /foobar/Foo-Bridging-Header.h:14:9: note: in file included from /foobar/Foo-Bridging-Header.h:14:
#import "TPPreciseTimer.h"
  ^

error: /foobar/Timer/TPPreciseTimer.h:9:9: error: 'Foundation/Foundation.h' file not found
#import <Foundation/Foundation.h>
  ^

/foobar/Timer/TPPreciseTimer.h:9:9: note: did not find header 'Foundation.h' in framework 'Foundation' (loaded from '/System/Library/Frameworks')
#import <Foundation/Foundation.h>
  ^

error: failed to import bridging header '/foobar/Foo-Bridging-Header.h'
.
Shared Swift state for Foo has developed fatal errors and is being discarded.
REPL definitions and persistent names/types will be lost.

Message from debugger: The LLDB RPC server has crashed. The crash log is located in ~/Library/Logs/DiagnosticReports and has a prefix 'lldb-rpc-server'. Please file a bug and attach the most recent crash log.


Anyone know a workaround for something like this?

My coworkers still on Xcode 10.3 are not having this issue with the same codebase.

I had a similar problem. The "solution" was to completely reinitialize cocoapods and delete DerivedData.

What do you mean by reinitialize cocoapods?

Tried to reinitialize CocoaPods (clean and reinstall) and still have the same issue.

Any other suggestions ? I'm evaluating a complete clean re-install of XCode...

Having the same problem, done all the "total clean of cocoa pods and derived data".
In my case it only effects applications which uses the CSV.swift framework and it's only from that it complains.

warning: Swift error in fallback scratch context: <module-includes>:1:9: note: in file included from <module-includes>:1:

#import "Headers/CSV.swift-umbrella.h"

^


error: /Users/totte/Documents/projects/Projects for Asset TV/GroupTime/GroupTime/Pods/Target Support Files/CSV.swift/CSV.swift-umbrella.h:2:9: error: 'Cocoa/Cocoa.h' file not found

#import <Cocoa/Cocoa.h>

^


/Users/totte/Documents/projects/Projects for Asset TV/GroupTime/GroupTime/Pods/Target Support Files/CSV.swift/CSV.swift-umbrella.h:2:9: note: did not find header 'Cocoa.h' in framework 'Cocoa' (loaded from '/System/Library/Frameworks')

#import <Cocoa/Cocoa.h>

^


error: could not build Objective-C module 'CSV'



note: This error message is displayed only once. If the error displayed above is due to conflicting search paths to Clang modules in different images of the debugged executable, this can slow down debugging of Swift code significantly, since a fresh Swift context has to be created every time a conflict is encountered.


Anyone has any more ideas? Do the framework needs changes?


I have the same issue, and tried to:

  1. pod deintegrate
  2. pod install
Xcode 11 debugger crashes on breakpoint, can't find Foundation.h
 
 
Q