{"record":{"id":"17ef5c81e1f32b1c","repo":"Unity-Technologies/UnityCsReference","slug":"cannot-create-build-profile-for-platformname","errorCode":null,"errorMessage":"Cannot create build profile for '{platformName}' (GUID: {platformId}). This platform is not installed in the editor. ","messagePattern":"Cannot create build profile for '(.+?)' \\(GUID: (.+?)\\)\\. This platform is not installed in the editor\\. ","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"Editor/Mono/BuildProfile/BuildProfile.Create.cs","lineNumber":127,"sourceCode":"        {\n            // Ensure the base platform is installed. Derived platforms will\n            // be automatically loaded during profile initialization.\n            bool isPlatformInstalled = false;\n            GUID basePlatformGUID = BuildTargetDiscovery.GetBasePlatformGUID(platformId);\n            var installedPlatforms = BuildProfile.GetInstalledPlatformModules();\n            foreach (var platform in installedPlatforms)\n            {\n                if (basePlatformGUID == platform.platformGuid)\n                {\n                    isPlatformInstalled = true;\n                    break;\n                }\n            }\n\n            if (!isPlatformInstalled)\n            {\n                var platformName = BuildTargetDiscovery.BuildPlatformDisplayName(platformId);\n                throw new ArgumentException(\n                    $\"Cannot create build profile for '{platformName}' (GUID: {platformId}). \"\n                    + $\"This platform is not installed in the editor. \");\n            }\n\n            BuildProfileModuleUtil.EnsureCustomBuildProfileFolderExists();\n            string assetPath = BuildProfileModuleUtil.GetProfilePathWithProvidedName(platformId, profileName);\n            var packagesToInstall = BuildTargetDiscovery.GetAllMissingRequiredPlatformPackageNames(platformId);\n\n            return CreateInstance(platformId, assetPath, -1, packagesToInstall, onProfileReady);\n        }\n\n        /// <summary>\n        /// Internal helper function for creating new build profile assets and invoking the onBuildProfileCreated\n        /// event after an asset is created by AssetDatabase.CreateAsset.\n        /// </summary>\n        [VisibleToOtherModules(\"UnityEditor.BuildProfileModule\")]\n        internal static BuildProfile CreateInstance(GUID platformId, string assetPath)\n        {","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/BuildProfile/BuildProfile.Create.cs#L109-L145","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Install the missing platform module via Unity Hub (Installs > Add Modules) for the editor version in use.","Verify the platformId/GUID you are passing is correct and still valid for the installed Unity version.","On CI, ensure the build image includes the required platform modules before invoking profile creation."],"exampleFix":"// before\nBuildProfile.Create(somePlatformGuidNotInstalled, \"MyProfile\");\n\n// after\n// In Unity Hub: Installs -> <version> -> Add Modules -> enable the platform.\n// Then retry:\nBuildProfile.Create(correctPlatformGuid, \"MyProfile\");","handlingStrategy":"validation","validationCode":"bool installed = BuildTargetDiscovery.GetAllPlatforms() /* installed set */; // verify module presence before creating","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install required platform modules via Unity Hub before scripting profile creation.","On CI, bake platform modules into the editor image.","Confirm the platformId is correct for the Unity version."],"tags":["unity","buildprofile","platform","module-not-installed","argumentexception"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}