I recently added Swift to my existing objective-c static library project and encountering issues when debugging Swift code.
While in a breakpoint and entering po command to print a variable value I get:
error: expression failed to parse:
error: Couldn't realize type of self
Note the following:
- The project is an
objective-cstatic library with recently addedSwiftfiles. - The error appears only when breakpoint is in a
Swiftfile. There is no issues while debuggingobjective-cfile (*.m file). - Xcode version is 14.1
- Project is using
CocoaPods. - There are no issues with compilation and runtime. The only issue is with debugging Swift code.
- When running
swift-healthcheckfrom breakpoint, there are plenty of errors as follow:
LoadOneModule() -- Missing Swift module or Clang module found for "Infra", "imported" via SwiftDWARFImporterDelegate. Hint: Register Swift modules with the linker using -add_ast_path.
While Infra is the name of my static library. (I couldn't find any helpful instructions explaining how to register swift modules, while I'm not even sure it points to the actual issue).
Any suggestions will be highly appreciated.