Module was not compiled with library evolution support; using it means binary compatibility for can't be guaranteed
Asked Answered
A

4

20

Recently I face this compile time warning for a SDK. Does it means it is not build with the Target setting "Build Libraries for Distribution"?.

Screenshot

Areopagus answered 11/2, 2020 at 4:50 Comment(0)
G
25

You need to set Build Libraries for Distribution in the Project Build Settings to No then it will disappear.

Goulette answered 15/12, 2020 at 23:4 Comment(7)
I think you have to come to an agreement with @Jafar's answerEnrico
@Enrico Setting it to No fixes the issue not to YesGoulette
@Goulette answer fixed my issue on Xcode 12.5Forfeit
That fixes it, but can anyone share what it exactly this warning means and what the impact is to ignoring it? If you do want to build for distribution and get this warning, what steps should you take to ensure your distribution build works as expected?Fuchs
@Fuchs It means you lose XCFramework compatibility. If you aren't distributing XCFrameworks, don't worry about it. The issue was you had a dependency that did not have it enabled, therefor you could not distribute yours with the guarantee you would not break the ABI.Bettyannbettye
@Goulette I had to set it to YES to get rid of the warning messages.Cupellation
@Goulette I disagree with this answer. The OP is compiling an SDK so disabling library evolution will cause problems downhill when the SDK gets distributed to third parties.Fiche
F
2

In an SDK I am distributing to external companies I use

@_implementationOnly import ***

when importing third-party swift packages, to prevent the SDK's dependencies from being exported along with the SDK.

Note that @_implementationOnly is not widely documented, it is however largely used also by major SDKs (e.g. Firebase).

Reference: https://github.com/apple/swift/blob/main/docs/ReferenceGuides/UnderscoredAttributes.md

Fiche answered 7/5, 2024 at 12:51 Comment(0)
L
0

yes, if you set Build Libraries for Distribution to Yes, it will disappear.

Lepanto answered 11/2, 2020 at 12:9 Comment(5)
In my case they are set to 'YES' but still the error occurs, ideas?Egoist
The other answer suggest the opposite, set it to YES, either way they don't provide any information what may cause the warning.Egoist
In MyCase set Yes to resovledRefute
What about setting the above in a swift package?Dalessandro
This is a good case of doubleThink - I am starting to believe that these 2 mutually exclusive responses are both true... A bit Orwellian..... : )Bergstein
P
0

I think part of the confusion in the other answers is that there are multiple targets within their projects.

All of the targets need to have the same setting for Build Libraries for Distribution.

Mine had conflicts and when I deleted the overrides for the conflicting targets, all relied on the project setting and it compiled fine without the warning.

Prim answered 25/7, 2024 at 20:39 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.