Unity-Technologies/UnityCsReference · error · ArgumentException

Cannot create build profile for '{platformName}' (GUID: {pla

Error message

Cannot create build profile for '{platformName}' (GUID: {platformId}). This platform is not installed in the editor. 

What it means

Thrown during BuildProfile creation when the requested platform (matched by basePlatformGUID) is not present among the editor's installedPlatforms. The code iterates installed platforms; if none match, it resolves the display name via BuildTargetDiscovery.BuildPlatformDisplayName and throws ArgumentException telling the user the platform module is not installed. Installing the platform module is the only supported resolution.

Source

Thrown at Editor/Mono/BuildProfile/BuildProfile.Create.cs:127

        {
            // Ensure the base platform is installed. Derived platforms will
            // be automatically loaded during profile initialization.
            bool isPlatformInstalled = false;
            GUID basePlatformGUID = BuildTargetDiscovery.GetBasePlatformGUID(platformId);
            var installedPlatforms = BuildProfile.GetInstalledPlatformModules();
            foreach (var platform in installedPlatforms)
            {
                if (basePlatformGUID == platform.platformGuid)
                {
                    isPlatformInstalled = true;
                    break;
                }
            }

            if (!isPlatformInstalled)
            {
                var platformName = BuildTargetDiscovery.BuildPlatformDisplayName(platformId);
                throw new ArgumentException(
                    $"Cannot create build profile for '{platformName}' (GUID: {platformId}). "
                    + $"This platform is not installed in the editor. ");
            }

            BuildProfileModuleUtil.EnsureCustomBuildProfileFolderExists();
            string assetPath = BuildProfileModuleUtil.GetProfilePathWithProvidedName(platformId, profileName);
            var packagesToInstall = BuildTargetDiscovery.GetAllMissingRequiredPlatformPackageNames(platformId);

            return CreateInstance(platformId, assetPath, -1, packagesToInstall, onProfileReady);
        }

        /// <summary>
        /// Internal helper function for creating new build profile assets and invoking the onBuildProfileCreated
        /// event after an asset is created by AssetDatabase.CreateAsset.
        /// </summary>
        [VisibleToOtherModules("UnityEditor.BuildProfileModule")]
        internal static BuildProfile CreateInstance(GUID platformId, string assetPath)
        {

View on GitHub (pinned to 225b0fbdb5)

Solutions

  1. Install the missing platform module via Unity Hub (Installs > Add Modules) for the editor version in use.
  2. Verify the platformId/GUID you are passing is correct and still valid for the installed Unity version.
  3. On CI, ensure the build image includes the required platform modules before invoking profile creation.

Example fix

// before
BuildProfile.Create(somePlatformGuidNotInstalled, "MyProfile");

// after
// In Unity Hub: Installs -> <version> -> Add Modules -> enable the platform.
// Then retry:
BuildProfile.Create(correctPlatformGuid, "MyProfile");
Defensive patterns

Strategy: validation

Validate before calling

bool installed = BuildTargetDiscovery.GetAllPlatforms() /* installed set */; // verify module presence before creating

Prevention

When it happens

Trigger: Calling the create-profile API with a platformId whose basePlatformGUID is not in BuildTargetDiscovery's installed platforms list — i.e. the editor build does not include that platform module.

Common situations: Building on a Unity install that lacks a platform module (e.g. Linux build support on a Windows-only install); targeting a platform removed/renamed in a Unity version upgrade; corrupted module installation; CI images missing optional platform modules.

Related errors


AI-assisted analysis of Unity-Technologies/UnityCsReference@225b0fbdb5 (2026-08-13). Data as JSON: /api/errors/17ef5c81e1f32b1c. Report an issue: GitHub.