You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can find a sample project which reproduces the issue attached. Open the project and set a breakpoint at `NiceSwiftFile.swift:21`. Run the project and when it stops at the breakpoint, follow the instructions in the source file. It was created from scratch and only a few build settings were modified to get it to compile and import Swift correctly:
The main target was modified as follows:
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
LIBRARY_SEARCH_PATHS = $TOOLCHAIN_DIR/usr/lib/swift/$PLATFORM_NAME;
HEADER_SEARCH_PATHS = $SRCROOT/Output; // Make sure that we can import the Objective-C generated header
Static library target:
DERIVED_FILE_DIR = $SOURCE_ROOT/Output/LibraryWithSwift // produce the generated header in a directory importable by the main target
The Objective-C generated interface header is imported in the AppDelegate.m where a method defined in the Swift static library is invoked. Setting a breakpoint on this method and printing any variable in the Swift context fails in Xcode 9.4.1 and Xcode 10.
A known workaround is to add `-Xlinker -add_ast_path -Xlinker $(BUILT_PRODUCTS_DIR)/LibraryWithSwift.swiftmodule/x86_64.swiftmodulee` to the main app target for every Swift module as suggested in SR-2660.
This bug may be related to the one just mentioned, but I felt that opening a new one makes sense since in this project only one Static library is required to demonstrate the issue.
The text was updated successfully, but these errors were encountered:
Attachment: Download
Environment
Additional Detail from JIRA
md5: 56a06762cce132fbb760f75d805c52db
Issue Description:
When trying to po a variable in a static library that contains Swift linked to an Objective-C target, the debugger fails with the following message:
You can find a sample project which reproduces the issue attached. Open the project and set a breakpoint at `NiceSwiftFile.swift:21`. Run the project and when it stops at the breakpoint, follow the instructions in the source file. It was created from scratch and only a few build settings were modified to get it to compile and import Swift correctly:
The main target was modified as follows:
Static library target:
The Objective-C generated interface header is imported in the AppDelegate.m where a method defined in the Swift static library is invoked. Setting a breakpoint on this method and printing any variable in the Swift context fails in Xcode 9.4.1 and Xcode 10.
A known workaround is to add `-Xlinker -add_ast_path -Xlinker $(BUILT_PRODUCTS_DIR)/LibraryWithSwift.swiftmodule/x86_64.swiftmodulee` to the main app target for every Swift module as suggested in SR-2660.
This bug may be related to the one just mentioned, but I felt that opening a new one makes sense since in this project only one Static library is required to demonstrate the issue.
The text was updated successfully, but these errors were encountered: