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-c static library with recently added Swift files.
The error appears only when breakpoint is in a Swift file. There is no issues while debugging objective-c file (*.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-healthcheck from 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.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Seems like a bug on the Xcode 15.0 beta.
Steps to reproduce:
Create a new empty Static Library project in Xcode (objective-C)
Add a String Catalog file
Add a dummy function which includes NSString *str = NSLocalizeString(@"test string", @"comment");
Build the project.
Result: String Catalog is empty while it should be updated with "test string".
I submitted FB12408229
Anyone encountered this? Anyone from Apple can kindly confirm?
I have an iOS app with the following configuration:
My own ObjC static library project - MyStaticLib
My own ObjC app target project - MyApp
I have both projects in the same Xcode workspace so that MyStaticLib is linked successfully to MyApp
Both projects have a mix of ObjC and Swift code successfully working.
Currently:
MyStaticLib: ObjC code can access Swift code and vice versa
MyApp: ObjC code can access Swift code and vice versa
ObjC code from MyApp can access ObjC code from MyStaticLib (This is achieved by adding Copy Files in Build Phases at MyStaticLib project settings with the ObjC header files)
Objective:
Swift code located in MyApp to access Swift code located in MyStaticLib
Issues:
If I'm trying to call a public Swift function located in MyStaticLib from MyApp, I get Cannot find 'YYY' in scope.
If I'm adding import MyStaticLib, I get dozens of Duplicate interface definition for class 'ZZZ'
Any idea how to resolve this?