Unity-Technologies/UnityCsReference · error · NotSupportedException

Platform does not implement DeploymentTargetsExtension

Error message

Platform does not implement DeploymentTargetsExtension

What it means

Thrown by DeploymentTargetManager.GetExtension when ModuleManager.GetDeploymentTargetsExtension(buildTarget) returns null — i.e. the active build target platform has no deployment-target (device) extension module installed or implemented. NotSupportedException indicates a missing platform capability rather than a transient failure. Deployment target APIs only exist for platforms that ship a device manager (e.g. Android, iOS); Standalone and others do not.

Source

Thrown at Editor/Mono/DeploymentTargets/DeploymentTargetManager.cs:43

            return context != null ? new DeploymentTargetManager(extension, context) : null;
        }

        public static DeploymentTargetManager CreateInstance(BuildTargetGroup buildTargetGroup, BuildTarget buildTarget, bool setup = true)
        {
            return CreateInstance(buildTarget, setup);
        }

        DeploymentTargetManager(IDeploymentTargetsExtension extension, IDeploymentTargetsMainThreadContext context)
        {
            m_Extension = extension;
            m_Context = context;
        }

        static IDeploymentTargetsExtension GetExtension(BuildTarget buildTarget)
        {
            var extension = ModuleManager.GetDeploymentTargetsExtension(buildTarget);
            if (extension == null)
                throw new NotSupportedException(k_ExtensionErrorMessage);
            return extension;
        }

        public IDeploymentTargetInfo GetTargetInfo(DeploymentTargetId targetId)
        {
            return m_Extension.GetTargetInfo(m_Context, targetId);
        }

        public IDeploymentLaunchResult LaunchBuildOnTarget(BuildProperties buildProperties, DeploymentTargetId targetId, ProgressHandler progressHandler = null)
        {
            return m_Extension.LaunchBuildOnTarget(m_Context, buildProperties, targetId, progressHandler);
        }

        public List<DeploymentTargetIdAndStatus> GetKnownTargets()
        {
            return m_Extension.GetKnownTargets(m_Context);
        }

View on GitHub (pinned to 225b0fbdb5)

Solutions

  1. Switch the active build target to a platform that supports deployment targets (Android/iOS) before calling the API: EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.Android, BuildTarget.Android).
  2. Install the missing platform module via Unity Hub (Add Modules) for the editor version in use.
  3. Guard before calling: check whether the build target is known to support device deployment and skip/warn otherwise.

Example fix

// before
var mgr = DeploymentTargetManager.GetDeploymentTargetManager(BuildTarget.StandaloneWindows64);
// after
if (BuildTargetIsStandalone(activeTarget)) { Debug.LogWarning("No deployment targets on Standalone"); return; }
var mgr = DeploymentTargetManager.GetDeploymentTargetManager(BuildTarget.Android);
Defensive patterns

Strategy: validation

Validate before calling

static readonly HashSet<BuildTarget> kDeploySupported = new()
{
    BuildTarget.Android, BuildTarget.iOS /*, others with device support */
};
if (!kDeploySupported.Contains(activeTarget)) { WarnAndSkip(); return; }

Try / catch

try { mgr = DeploymentTargetManager.GetDeploymentTargetManager(target); }
catch (NotSupportedException) { /* target has no device extension; skip device flow */ }

Prevention

When it happens

Trigger: Constructing DeploymentTargetManager for a BuildTarget whose platform module lacks IDeploymentTargetsExtension — typically Standalone (Windows/Mac/Linux), WebGL, or any build target whose platform support module is not installed.

Common situations: Calling Device Simulator or build-and-run device APIs while the active build target is Standalone; iterating over build targets and assuming all support device deployment; a module not installed (e.g. Android Build Support unchecked in Unity Hub) so the extension is absent.

Related errors


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