Hive Hive
Sign in

External SPM dependencies fail to build with “no such module” errors when using XcodeProj-based integration

GitHub issue · Open

Metadata
Source
tuist/tuist #9286
Updated
Jul 3, 2026
Domains
Generated projects
Details

What happened?

External SPM dependencies fail to build with “no such module” errors when using XcodeProj-based integration (Tuist/Package.swift). After running tuist install and tuist generate, the project generates successfully with all SPM packages converted to individual .xcodeproj files in Tuist/.build/tuist-derived/. However, when building any target that depends on these external packages, compilation fails with “no such module” errors.

Root cause:

External frameworks are referenced with sourceTree = BUILT_PRODUCTS_DIR in the main project Each SPM package builds into its own DerivedData directory (e.g., DerivedData/RxSwift-xxx/) The main project looks for frameworks in its own DerivedData (e.g., DerivedData/MyApp-xxx/) Frameworks are not found because they’re in different locations

Despite:

  • buildImplicitDependencies = “YES” set in schemes
  • All packages included in workspace-level scheme
  • 1244+ PBXContainerItemProxy entries in project.pbxproj
  • Correct framework references in build phases

The implicit dependency mechanism fails to locate built products across different project DerivedData directories.

Framework reference in main project: MyApp.xcodeproj/project.pbxproj: 0FEE3F4B66E135E3B47098CC /* RxRelay.framework */ = { isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxRelay.framework; sourceTree = BUILT_PRODUCTS_DIR; // ⚠️ Points to main project's DerivedData };

How do we reproduce it?

Include multiple external packages in Package.swift and add them to the target via .external(name:). Do not use `resolveDependenciesWithSystemScm.```

Error log

/path/to/project/Domain/Checkout/CartBonusStorage.swift:3:8: error: no such module ‘RxRelay’ import RxRelay ^

/path/to/project/Domain/Managers/AppBadgeManager.swift:3:8: error: no such module ‘RxRelay’ import RxRelay ^

[… repeated for 19 files …]

** BUILD FAILED **

macOS version

26.2.0

Tuist version

4.131.1

Xcode version

26.2.0

Flights

Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.

New Flights are paused Configure model inference, GitHub, and a sandbox provider to start another Flight. Existing results remain available below.
No Flights yet

Start a Flight and preserve its objective, outcome, and session here.

Comments
L
linear[bot] Jan 29, 2026
D
dosubot[bot] Jan 29, 2026

This happens because Tuist’s XcodeProj-based SPM integration generates a separate Xcode project for each package, so each package builds into its own DerivedData directory. The main project expects frameworks in its own DerivedData, but the SPM package builds put them elsewhere, causing the “no such module” errors. Tuist references frameworks using sourceTree = BUILT_PRODUCTS_DIR, which doesn’t resolve across these separate DerivedData locations, and there isn’t a built-in configuration or workaround to unify DerivedData or adjust framework search paths to fix this automatically docs, code.

Workarounds: use Xcode’s native SPM integration instead of XcodeProj-based, or always build the full workspace (not just the main project) so all dependencies are built and available community. If you need to share code across boundaries, consider turning it into a local Swift package. There is currently no documented or undocumented Tuist setting to resolve this DerivedData separation issue.

To reply, just mention @dosu.


Docs are dead. Just use Dosu.

Leave Feedback Ask Dosu about tuist Share Dosu with your team

P
pepicrft Jan 29, 2026

@losharik could you please include a project where I can reproduce the issue?

L
losharik Jan 29, 2026

@pepicrft I’ll put together a demo project and share the link within a couple of days.