Hello,
I’m building a Swift-based SDK (using SwiftUI) that will be distributed as a single .xcframework, and consumed by a React Native application. The SDK has multiple internal module dependencies (e.g., Essentials, CoreModels, CoreRepository), each of which is currently implemented as a local Swift Package (SPM).
When I attempt to archive the main SDK framework using xcodebuild archive with BUILD_LIBRARY_FOR_DISTRIBUTION=YES, the archive process fails during SwiftEmitModule for these SPMs. I understand this likely relates to module stability requirements for .xcframework distribution.
My key question:
Is it mandatory to convert all Swift Packages (SPMs) into Xcode framework targets in order to successfully archive and bundle them into a distributable .xcframework?
Or alternatively, is there a recommended approach to make Swift Packages archive-compatible for use in a compiled, closed-source SDK, without converting them into Xcode framework targets?
Awaiting your guidance.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hello,
I’ve created a custom SDK from my iOS application to be integrated into another app. The SDK depends on Google Maps and payment gateway libraries.
If I exclude these third-party libraries from the SDK, I encounter multiple errors. However, if I include them, the host app throws errors due to duplicate dependencies, since it already integrates the same libraries.
I understand that third-party dependencies can be downloaded separately by adding them through Swift Package Manager (SPM). However, the issue is that if I exclude these dependencies from my SDK, I get compilation errors wherever I’ve used import GoogleMaps or similar statements in my code.
Could you please guide me — or share documentation — on the correct approach to create an SDK that excludes third-party libraries?