Dependency adds redundant Target Capabilities

Question or problem

I’ve encountered an issue with a Tuist-based iOS project. When I add certain third-party dependencies (e.g., GoogleTagManager or FirebaseAnalytics), my Xcode target automatically gets the In-App Purchase capability added, even though I have not explicitly enabled it in my Target.entitlements dictionary or anywhere else in my configuration.

Expectation

I expected that if I do not explicitly include or enable “In-App Purchase” in my target configuration(in entitlements()), then Tuist would not add it as a capability to my Xcode’s target. I’d like to keep my target capabilities as minimal as possible.

Context

  • Tuist version: 4.43.2
  • I have a Project.swift that defines a main app target.
// provide entitlements!!!, (I don't provide any related to"In-App Purchase" )
func entitlements() -> Entitlements? {
    let result: Entitlements = .dictionary([
        "aps-environment": .string("development"),
        "com.apple.developer.applesignin": .array([
            .string("Default")
        ]),
        "Can be debugged": .boolean(true)
    ])
    return result
}


let project = Project(
    name: "CleanExampleOne",
    targets: [
        .target(
            name: "CleanExampleOne",
            destinations: .iOS,
            product: .app,
            bundleId: "io.tuist.CleanExampleOne",
            infoPlist: .extendingDefault(
                with: [
                    "UILaunchScreen": [
                        "UIColorName": "",
                        "UIImageName": "",
                    ],
                ]
            ),
            sources: ["CleanExampleOne/Sources/**"],
            resources: ["CleanExampleOne/Resources/**"],
            entitlements: entitlements(),
            dependencies: [
                .external(name: "GoogleTagManager"),

                // https://firebase.google.com/docs/ios/setup#available-pods
//                .external(name: "FirebaseCore"),
//                .external(name: "FirebaseAuth"),
//                .external(name: "FirebaseMessaging"),
//                .external(name: "FirebasePerformance"),
//                .external(name: "FirebaseCrashlytics"),
//                .external(name: "FirebaseAnalytics"),  <--- too
//                .external(name: "FirebaseStorage"),
            ]
        ),
        .target(
            name: "CleanExampleOneTests",
            destinations: .iOS,
            product: .unitTests,
            bundleId: "io.tuist.CleanExampleOneTests",
            infoPlist: .default,
            sources: ["CleanExampleOne/Tests/**"],
            resources: [],
            dependencies: [.target(name: "CleanExampleOne")]
        ),
    ]
)

and then run tuist generate , the generated Xcode project’s target shows the In-App Purchase capability enabled by default.

Reproduction (steps)

  1. Open project .
    empty_tuist.zip (42.8 KB)

  2. Run tuist install.

  3. Run tuist generate.

  4. Open the workspace in Xcode.

  5. Go to Signing & Capabilities for the app target ““CleanExampleOne””. You should see In-App Purchase enabled—even though it was never explicitly added.

Additional details

  • I do not use In-App Purchases in my project and would prefer not to enable that capability.
  • Is there a known reason or mechanism by which certain dependencies might trigger this extra capability?
  • Any guidance on how to remove or avoid it (additional capability) would be greatly appreciated.

Thanks in advance for your help and any insights you can provide!

Hey @Vitalik :wave:

This is a known issue. I posted some findings here. I’d suggest moving the conversation over to GitHub in this case.

Someone reported that the additional capability is harmless, but I agree it would be better if it wasn’t added in the first place – but we’d need to find a way to trick Xcode as the capability is not added by Tuist at all.

ok, @marekfort
thanks for your answer