{"record":{"id":"bacc059d55aa54b4","repo":"Unity-Technologies/UnityCsReference","slug":"platform-does-not-implement-deploymenttargetsexten","errorCode":null,"errorMessage":"Platform does not implement DeploymentTargetsExtension","messagePattern":"Platform does not implement DeploymentTargetsExtension","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"Editor/Mono/DeploymentTargets/DeploymentTargetManager.cs","lineNumber":43,"sourceCode":"            return context != null ? new DeploymentTargetManager(extension, context) : null;\n        }\n\n        public static DeploymentTargetManager CreateInstance(BuildTargetGroup buildTargetGroup, BuildTarget buildTarget, bool setup = true)\n        {\n            return CreateInstance(buildTarget, setup);\n        }\n\n        DeploymentTargetManager(IDeploymentTargetsExtension extension, IDeploymentTargetsMainThreadContext context)\n        {\n            m_Extension = extension;\n            m_Context = context;\n        }\n\n        static IDeploymentTargetsExtension GetExtension(BuildTarget buildTarget)\n        {\n            var extension = ModuleManager.GetDeploymentTargetsExtension(buildTarget);\n            if (extension == null)\n                throw new NotSupportedException(k_ExtensionErrorMessage);\n            return extension;\n        }\n\n        public IDeploymentTargetInfo GetTargetInfo(DeploymentTargetId targetId)\n        {\n            return m_Extension.GetTargetInfo(m_Context, targetId);\n        }\n\n        public IDeploymentLaunchResult LaunchBuildOnTarget(BuildProperties buildProperties, DeploymentTargetId targetId, ProgressHandler progressHandler = null)\n        {\n            return m_Extension.LaunchBuildOnTarget(m_Context, buildProperties, targetId, progressHandler);\n        }\n\n        public List<DeploymentTargetIdAndStatus> GetKnownTargets()\n        {\n            return m_Extension.GetKnownTargets(m_Context);\n        }\n","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/DeploymentTargets/DeploymentTargetManager.cs#L25-L61","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Switch the active build target to a platform that supports deployment targets (Android/iOS) before calling the API: EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.Android, BuildTarget.Android).","Install the missing platform module via Unity Hub (Add Modules) for the editor version in use.","Guard before calling: check whether the build target is known to support device deployment and skip/warn otherwise."],"exampleFix":"// before\nvar mgr = DeploymentTargetManager.GetDeploymentTargetManager(BuildTarget.StandaloneWindows64);\n// after\nif (BuildTargetIsStandalone(activeTarget)) { Debug.LogWarning(\"No deployment targets on Standalone\"); return; }\nvar mgr = DeploymentTargetManager.GetDeploymentTargetManager(BuildTarget.Android);","handlingStrategy":"validation","validationCode":"static readonly HashSet<BuildTarget> kDeploySupported = new()\n{\n    BuildTarget.Android, BuildTarget.iOS /*, others with device support */\n};\nif (!kDeploySupported.Contains(activeTarget)) { WarnAndSkip(); return; }","typeGuard":null,"tryCatchPattern":"try { mgr = DeploymentTargetManager.GetDeploymentTargetManager(target); }\ncatch (NotSupportedException) { /* target has no device extension; skip device flow */ }","preventionTips":["Gate device-deployment UI behind the active build target being a device platform.","Install the platform module in Unity Hub before relying on its deployment extension.","Do not assume every BuildTarget enumerates devices."],"tags":["editor","deployment","platform","build-target","module","android","ios"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}