TLDR: Adding the Facebook SDK to a fresh, empty Xcode project yields an executable that links to AdSupport.
Q: Can I prevent this?
This happens without importing or using the SDK. The mere presence of the dependency (via SPM) in an otherwise empty app triggers the inclusion of AdSupport.framework
in the executable, as confirmed by nm
and otool.
The phrase "Facebook SDK does not require AdSupport.framework to be included." appears in lots of searches, but is never accompanied with an explanation of how to exclude the framework.
This is also a question for a Facebook forum, but I am posting it here as a question about build tools: Apart from downloading the SDK source and painstakingly commenting out the transitive closure of all references to AdSupport,
ASIdentifierManager,
and IDFA, are there any compile/link directives that could stop the inclusion of the forbidden fruit?