Previews stopped working when mergeable is enabled

Whenever we include the mergeable configuration on an xcframework which contains a SwiftUI preview, the preview can't compile. That's because it is trying to keep the dynamic configuration but on a binary type that is not a dynamic library.

It fails with the error:

Linking failed: linker command failed with exit code 1 (use -v to see invocation)
1d: -make_mergeable can only be used when creating a dynamic library clang: error: linker command failed with exit code 1 (use -v to see invocation)

That's only happening when we add the preview.

Hi,

Sorry to hear you are having problems getting previews working. Best next step will be to file a feedback with diagnostics so we can take a look.

Steps to generate helpful diagnostics:

  1. Download and install the logging profile on all devices involved. Instructions and profiles are available here: https://developer.apple.com/bug-reporting/profiles-and-logs/?name=swift
  2. Reproduce the issue
  3. Click the "Diagnostics" button in the error banner in Previews' Canvas area (or if the banner is missing you can use the menu: Editor > Canvas > Diagnostics)
  4. In the sheet that appears, click "Generate Report" in the bottom left of the sheet
  5. Attach (or make from the folder) the resulting zip file to the bug report (will be named something like previews-diagnostics-0123456789.zip)
Previews stopped working when mergeable is enabled
 
 
Q