I have a project that has an iOS app and a Messages app embedded in it. This project uses Swift Package Manager to manage its dependencies, including Alamofire and Valet, plus some private shared code among the app targets and the Vapor-based server code. When building with Xcode 11.4, I get build errors of the following type:
error: Swift package product 'Alamofire' is linked as a static library by 'EmojiClub' and 'EmojiClubMessages'. This will result in duplication of library code.
If I remove Alamofire (or any of the libraries for which this error happens) from the iOS app target or the Messages app target, then I get missing symbol build errors. I’ve seen some guidance on this around these forums to use
.dynamic in the Swift package declaration, but I can’t force third-party frameworks to do so. Is there a solution to this problem from within Xcode or SPM, or do I need to try making a new, dynamic Swift package for these dependencies and then import that in my app targets?