Question or problem
I’m working on a modular iOS application using Tuist, where each feature is defined as a separate module (target). Some features depend on the same external SPM dependencies (e.g., Moya, Alamofire, TCA, etc.).
When I try to build the main app target that includes multiple features, I receive runtime warnings and potential crashes due to the same static libraries being linked from multiple modules:
Target 'Alamofire' has been linked from target 'FeatureOne' and target 'FeatureTwo', it is a static product so may introduce unwanted side effects.
Expectation
A way to solve the problem with static linking
Context
- Tuist version: 4.50.1
- SwiftPM dependencies
- Each feature is a separate Target, and each is importing a common set of dependencies (e.g., Moya, TCA, etc.)
- The main app target depends on multiple feature targets
Reproduction (mandatory for problems)
- Create a Tuist project with the following structure:
App/
├── Features/
│ ├── FeatureOne/
│ └── FeatureTwo/
- Let both FeatureOne and FeatureTwo link to the same SPM dependencies (e.g., Moya, Alamofire, etc.)
- Let the main App target depend on both features
- Build and run — runtime warnings