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"?.
You need to set Build Libraries for Distribution
in the Project Build Settings
to No
then it will disappear.
No
fixes the issue not to Yes
–
Goulette 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
yes, if you set Build Libraries for Distribution
to Yes
, it will disappear.
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.
© 2022 - 2025 — McMap. All rights reserved.