Skip to content

Custom configuration names rejected in settings.configs and scheme definitions #1621

Closed as not planned

Description

@serhiybutz

When a project defines custom build configuration names (anything other than Debug or Release), XcodeGen rejects those names in two places:

  1. settings.configs keys in target definitions
  2. run.config, test.config, archive.config, profile.config values in scheme definitions

The validator appears to check against a hardcoded list of known configuration names rather than against the configurations actually defined in the project spec.

Reproduction

name: TestApp

configurations:
  Debug: debug
  Enterprise: release
  AppStore: release

targets:
  TestApp:
    type: application
    platform: iOS
    settings:
      configs:
        Enterprise:           # ← rejected: "invalid build configuration 'Enterprise'"
          SWIFT_VERSION: "5.0"

schemes:
  Enterprise:
    archive:
      config: Enterprise      # ← rejected: "Scheme has invalid build configuration 'Enterprise'"

Running xcodegen generate on this spec produces:

Spec validations errors:
  - Build setting has invalid build configuration "Enterprise"
  - Scheme "Enterprise" has invalid build configuration "Enterprise"

Expected Behaviour

Enterprise and AppStore are defined in the configurations: section of the spec. The validator should accept any configuration name declared there, not just Debug and Release.

Actual Behaviour

Any configuration name other than Debug or Release is rejected in settings.configs and scheme config fields, even when explicitly defined in the project spec.

Workaround

For build settings, there is a partial workaround using conditional key syntax in settings.base:

settings:
  base:
    "SWIFT_VERSION[config=Enterprise]": "5.0"

There is no equivalent workaround for scheme definitions. Schemes that reference custom configuration names cannot be expressed in project.yml at all, requiring scheme files to be managed outside the spec.

Versions Affected

Confirmed present in: 2.15.0, 2.20.0, 2.25.0, 2.30.0, 2.35.0, 2.38.0, 2.40.0, 2.42.0, 2.43.0, 2.45.4

This appears to have been present since at least v2.15.0 and has never been reported.

Impact

Projects that follow the common iOS pattern of having more than two build configurations (e.g. Debug, Enterprise, AppStore, DeveloperID) cannot define schemes in project.yml. This makes full XcodeGen adoption impractical for these projects without workarounds.

Activity

  1. nu11waredev commented on Nov 11, 2026

    @nu11waredev

    The top-level key in this spec is configurations:, but the project spec key is configs: (see Configs in Docs/ProjectSpec.md). The unknown key is ignored, so the project only has the default Debug and Release configurations, and Enterprise is correctly reported as invalid.

    With your spec reduced to one target and the first key renamed to configs:, generation succeeds on 2.46.0:

    configs:
      Debug: debug
      Enterprise: release
      AppStore: release
    

    With configurations: in the same file, it fails with Build setting has invalid build configuration "Enterprise" and Scheme "Enterprise" has invalid build configuration "Enterprise".

    A warning for unrecognised top-level keys would catch this class of mistake; #1660 and #1661 do that for target keys.

  2. yonaskolb commented on Nov 19, 2026

    @yonaskolb
    Owner

    As noted above, the top-level key is configs: rather than configurations: (see Configs in Docs/ProjectSpec.md). With that rename the spec generates fine. We're working on warnings for unknown keys like this (#1673) so typos don't fail silently. Closing, but feel free to reopen if configs: still rejects your names.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions