Unity-Technologies/UnityCsReference · error · UnityException

Build target '{target}' not supported

Error message

Build target '{target}' not supported

What it means

Postprocess throws UnityException when ModuleManager.GetBuildPostProcessor(target) returns null, i.e. no platform module registered an IBuildPostprocessor for the requested target. Without a post-processor the build cannot be finalized for that platform.

Source

Thrown at Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:342

        [RequiredByNativeCode]
        static public void Postprocess(BuildTarget target, int subtarget, string installPath, string companyName, string productName,
            BuildOptions options,
            RuntimeClassRegistry usedClassRegistry, BuildReport report, string[] defineConstraints)
        {
            string stagingArea = "Temp/StagingArea";
            string stagingAreaData = "Temp/StagingArea/Data";
            string stagingAreaDataManaged = "Temp/StagingArea/Data/Managed";
            string playerPackage = BuildPipeline.GetPlaybackEngineDirectory(target, options);

            // Disallow providing an empty string as the installPath
            bool willInstallInBuildFolder = (options & BuildOptions.InstallInBuildFolder) != 0 && SupportsInstallInBuildFolder(target);
            if (installPath == String.Empty && !willInstallInBuildFolder)
                throw new Exception(installPath + " must not be an empty string");

            IBuildPostprocessor postprocessor = ModuleManager.GetBuildPostProcessor(target);
            if (postprocessor == null)
                // If postprocessor is not provided, build target is not supported
                throw new UnityException($"Build target '{target}' not supported");

            try
            {
                AddIconsArgs iconArgs;
                iconArgs.stagingArea = stagingArea;
                if (!postprocessor.AddIconsToBuild(iconArgs))
                    throw new BuildFailedException("Failed to add player icon");

                BuildPostProcessArgs args;
                args.target = target;
                args.subtarget = subtarget;
                args.stagingAreaData = stagingAreaData;
                args.stagingArea = stagingArea;
                args.stagingAreaDataManaged = stagingAreaDataManaged;
                args.playerPackage = playerPackage;
                args.installPath = installPath;
                args.companyName = companyName;
                args.productName = productName;

View on GitHub (pinned to 225b0fbdb5)

Solutions

  1. Install the build support module for the target (Unity Hub > Installs > Add Modules).
  2. Verify the target is supported by your Unity edition/license before building.
  3. Check Editor.log for module load failures if the module is installed but GetBuildPostProcessor still returns null.

Example fix

/* no source edit */
// before: build for BuildTarget.Android with no Android module -> throws
// after: Unity Hub > Installs > Add Modules > select Android Build Support > retry build
Defensive patterns

Strategy: validation

Validate before calling

if (ModuleManager.GetBuildPostProcessor(target) == null)
    throw new UnityException($"Build target '{target}' has no post-processor; install its module via Unity Hub.");

Type guard

static bool IsTargetSupported(BuildTarget t) => ModuleManager.GetBuildPostProcessor(t) != null;

Prevention

When it happens

Trigger: Building/Postprocessing for a target whose support module is not installed in the editor (e.g. building Android without the Android module, or a console target without its NDA module).

Common situations: Editor installed without the required platform module via Unity Hub; building a target only available in a different Unity edition; module failed to load at startup.

Related errors


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