H there!
I'm new to mergeable libraries, so sorry if I missed anything obvious. We have some really huge projects with mergeable libraries that started failing to build with Xcode 26 beta 3. After doing some research I managed to create a very small project where I was able to reproduce the issues. The project just contains a SwiftUI app and a framework. The framework includes just a class that is used from a SwiftUI view included in the app.
Problems
I found the following:
Default configuration (no mergeable libraries)
Everything works as expected
Automatic mergeable libraries
In this case I just set Create Merged Binary
to Automatic
. In this case:
- the application can be properly built and run in the simulator
- the SwiftUI preview stops working with the following report:
== PREVIEW UPDATE ERROR:
FailedToAnalyzeBuiltTargetDescription: Could not analyze the built target description for MLibTestCase to create the preview.
buildableName: MLibTestCase
==================================
| UnrecognizedLinkerArguments: Unrecognized linker arguments
|
| arguments: -no_merge_framework
|
Manual mergeable libraries
In this case I set:
Create Merged Binary
toAutomatic
in the app targetBuild Mergeable Library
toYes
in the library target
and I get exactly the same result as above. But if in addition I set:
MAKE_MERGEABLE
toYES
as aUser-Defined setting
in the library target
now things gets really worse, as:
- linking no longer works, failing with the following error:
duplicate symbol '_relinkableLibraryClassesCount' in:
[...]/Build/Products/Debug-iphonesimulator/MLib.framework/MLib
bundle-file
duplicate symbol '_relinkableLibraryClasses' in:
[...]/Build/Products/Debug-iphonesimulator/MLib.framework/MLib
bundle-file
ld: 2 duplicate symbols
- the SwiftUI preview fails, but now due to the error mentioned above:
== PREVIEW UPDATE ERROR:
SchemeBuildError: Failed to build the scheme “MLibTestCase”
linker command failed with exit code 1 (use -v to see invocation)
Conclusions, thoughts and doubts
After watching the WWDC session on mergeable libraries and reading the corresponding Apple documentation I got the feeling that Xcode would automatically manage mergeable libraries in both Debug
and Release
configurations, doing different things, but after performing this experiment with Xcode 26 beta 3 I'm no longer convinced that this is the case.
Anyway, our projects seemed to be working properly until Xcode 26 beta 2, using the last mentioned settings, this is, manual merged binary, with frameworks including the build mergeable library and MAKE_MERGEABLE
settings.
In addition, the symbols causing the duplication error seem to be synthesized by the linker in the case of mergeable libraries, so it's weird to get this error related with something that the linker is supposed to manage automatically. And don't forget that Unrecognized linker argument...
So:
- Has Xcode 26 beta 3 changed the way mergeable libraries are treated and configured, or is this a bug?
- In case this is not a bug, are we now supposed to provide different settings for
Debug
andRelease
builds? (I could create a merged binary only in theRelease
configuration, but again, we didn't have to do this before this Xcode version)
This is one of those cases where it doesn’t really matter whether it’s a ‘bug’ or a ‘feature’. What you’re trying to do is perfectly reasonable, so if it fails in inconvenient ways you should definitely file a bug about it.
Please post your bug number, just for the record.
After doing some research I managed to create a very small project where I was able to reproduce the issues.
Excellent. If you attach that to your bug report, that’ll be a great help.
Oh, one last thing: We just seeded Xcode 26.0b4 yesterday. It’d make sense for you to retest with that before spending any more time on this.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"