Hive Hive
Sign in

Using usercentricsUI with Tuist result in error Multiple commands produce UsercentricsUI.framework

GitHub issue · Open

Metadata
Source
tuist/tuist #7406
Updated
Jun 11, 2026
Domains
Generated projects
Details

What happened?

When adding usercentricsUI to Tusing using the SPM package, the generated project failed to build due to the error Multiple commands produce UsercentricsUI.framework

How do we reproduce it?

  1. Create a new Tuist project
  2. add dependency for usercentricsUI
  3. Generate & Build the App

example: Tuist-Usercentrics.zip

Error log

Showing All Messages
Multiple commands produce '/Users/user/Library/Developer/Xcode/DerivedData/Tuist-Usercentrics-erginafwqjrrjrglziourtzamaex/Build/Products/Debug-iphonesimulator/UsercentricsUI.framework'
Command: ProcessXCFramework /Users/user/Desktop/Tuist-Usercentrics/Tuist/.build/artifacts/usercentrics-spm-ui/UsercentricsUIFramework/UsercentricsUI.xcframework /Users/user/Library/Developer/Xcode/DerivedData/Tuist-Usercentrics-erginafwqjrrjrglziourtzamaex/Build/Products/Debug-iphonesimulator/UsercentricsUI.framework ios simulator
Target 'UsercentricsUI' (project 'UsercentricsUI') has create directory command with output '/Users/user/Library/Developer/Xcode/DerivedData/Tuist-Usercentrics-erginafwqjrrjrglziourtzamaex/Build/Products/Debug-iphonesimulator/UsercentricsUI.framework'
### macOS version
14.7
### Tuist version
4.44.2
### Xcode version
16.1
Comments
D
dosubot[bot] Mar 14, 2025

Hey @embassem! I’m here to help you out with any issues you’re facing. Let’s tackle this together!

The “Multiple commands produce” error in Xcode projects, including those generated by Tuist, often occurs when two or more build commands try to create the same output file. In this case, it seems to be related to the UsercentricsUI.framework.

Here are some steps you can take to resolve this issue:

  1. Check for Duplicate Framework References: Ensure that UsercentricsUI is not being added multiple times in your Tuist configuration. This can happen if the framework is declared both as an SPM dependency and manually added elsewhere in the project.

  2. Review Tuist Configuration: Look into your Project.swift or Dependencies.swift files to ensure that the UsercentricsUI dependency is declared correctly and not duplicated. Make sure that the framework is only being linked once.

  3. Exclude Duplicate Resources: If the issue is related to resources within the framework, you might need to exclude certain resources from being copied multiple times. You can use ResourceFileElement.glob to exclude specific resources if necessary [1].

  4. Check Build Phases: In the generated Xcode project, inspect the “Build Phases” of the target to ensure that the framework is not being processed multiple times. Look for any custom scripts or phases that might be duplicating the work.

  5. Clean Build Folder: Sometimes, residual files in the build folder can cause conflicts. Try cleaning the build folder by going to Product > Clean Build Folder in Xcode.

  6. Update Tuist and Dependencies: Ensure that you are using the latest versions of Tuist and the UsercentricsUI package, as updates might contain fixes for such issues.

If these steps do not resolve the issue, you might need to provide more specific details about your Tuist setup or consider simplifying the project to isolate the problem.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

F
fortmarek Mar 19, 2025

Hey @embassem 👋

I looked into this and found the issue. The usercentricsUI has a product called UsercentricsUI. However, the product depends on this xcframework. And the framework inside that .xcframework is also called UsercentricsUI. That leads to a conflict as you suddenly have two targets called exactly the same, leading to the Multiple commands ... issue.

While I’m not sure why this works in a regular SwiftPM setup, I’m hesitant to be adding support for this – and this might very well be a limitation of the XcodeProj integration as I don’t see how we can use an xcframework that has the name as the target that imports.

It’s honestly a bit bonkers to me that this is a setup someone would come up with – but maybe I’m missing the reason 🙃

Anyways, in this particular case, I’d recommend forking the dependency and renaming the SwiftPM product to something unique. Would that be possible?

D
dcacenabes May 23, 2025

Hey @fortmarek !

Anyways, in this particular case, I’d recommend forking the dependency and renaming the SwiftPM product to something unique. Would that be possible?

Do you mean something like:

products: [
.library(
name: "UsercentricsUI-newname",
targets: ["UsercentricsUI"]
)
],

in this package definition?

F
fortmarek May 23, 2025

Do you mean something like: products: [ .library( name: “UsercentricsUI-newname”, targets: [“UsercentricsUI”] ) ], in this package definition?

Yeah – ideally, you’d rename the internal UsercentricsUI.framework imported by the UsercentricsUI.xcframework binary, but I’m not aware you can easily do that. Alternatively, you can suggest to the UsercentricsUI to rename the prebuilt framework, although I can see from their point of view not wanting to do changes for Tuist’s sake.

D
dcacenabes May 23, 2025

Ok, I will try that quickly next week with a local package adding it to Tuist as .package(path: "/.../local-path/usercentrics-spm-ui/") and will report back to see what happens!

D
dcacenabes May 26, 2025

I tried but I still get the same error.

Multiple commands produce '/.../UsercentricsIntegrationDemo-eiqmlewjrpxvwkagxjqimggwoofl/Build/Products/Debug-iphonesimulator/UsercentricsUI.framework/UsercentricsUI'

Here’s a very minimal example project following this approach:

UsercentricsIntegrationDemo.zip Inside the Usercentrics directory there is the code from the latest version of usercentrics. I modified the package to be:

products: [
.library(
name: "ForkedUsercentricsUI",
targets: ["UsercentricsUI"]
)
],

then added it to the Tuist/Package.swift as a local dependency:

.package(path: "../Usercentrics")

And then in project.swift

dependencies: [
.external(name: "ForkedUsercentricsUI")
]
I
icedice Dec 8, 2025

Hi @dcacenabes did you ever solve this? I am having the exact same problem…

D
dcacenabes Dec 19, 2025

Hi @dcacenabes did you ever solve this? I am having the exact same problem…

@icedice unfortunately no, sorry.