Unity-Technologies/UnityCsReference · error · Exception
Failed to resolve standalone platform, platform string '{0}'
Error message
Failed to resolve standalone platform, platform string '{0}', resolved target '{1}' What it means
CalculateFinalPluginPath resolves the BuildTarget from a platform name string and checks it against the known standalone families (Windows, OSX, Linux). If none match, it throws because the DesktopPluginImporterExtension only knows how to place plugins for desktop standalone targets and cannot compute a path for anything else.
Source
Thrown at Editor/Mono/ImportSettings/DesktopPluginImporterExtension.cs:298
foreach (var importer in inspector.importers)
{
importer.SetPlatformData(target.platformName, cpuKey, target.value.ToString());
}
}
}
public override string CalculateFinalPluginPath(string platformName, PluginImporter imp)
{
BuildTarget target = BuildPipeline.GetBuildTargetByName(platformName);
bool pluginForWindows = target == BuildTarget.StandaloneWindows || target == BuildTarget.StandaloneWindows64;
#pragma warning disable 612, 618
bool pluginForOSX = target == BuildTarget.StandaloneOSXIntel || target == BuildTarget.StandaloneOSXIntel64 || target == BuildTarget.StandaloneOSX;
bool pluginForLinux = target == BuildTarget.StandaloneLinux || target == BuildTarget.StandaloneLinux64 || target == BuildTarget.StandaloneLinuxUniversal || target == BuildTarget.LinuxHeadlessSimulation;
#pragma warning restore 612, 618
if (!pluginForLinux && !pluginForOSX && !pluginForWindows)
throw new Exception(string.Format("Failed to resolve standalone platform, platform string '{0}', resolved target '{1}'",
platformName, target.ToString()));
if (pluginForWindows && !IsUsableOnWindows(imp))
return string.Empty;
if (pluginForOSX && !IsUsableOnOSX(imp))
return string.Empty;
if (pluginForLinux && !IsUsableOnLinux(imp))
return string.Empty;
string cpu = imp.GetPlatformData(platformName, cpuKey);
if (string.Compare(cpu, "None", true) == 0)
return string.Empty;
if (pluginForWindows)
{
if (string.Compare(cpu, nameof(DesktopPluginCPUArchitecture.ARM64), true) == 0)
{View on GitHub (pinned to 225b0fbdb5)
Solutions
- Ensure the platformName passed is one of the recognized standalone platform names before calling CalculateFinalPluginPath.
- Verify BuildPipeline.GetBuildTargetByName(platformName) returns a Standalone target; if it returns None or a non-standalone target, route to the correct extension instead.
- Update platform strings after a Unity upgrade if target names were deprecated (see the #pragma 612/618 suppressed legacy targets).
- Add a guard that skips desktop path calculation for non-standalone platforms.
Example fix
// before
string path = ext.CalculateFinalPluginPath(platformName, imp); // throws for non-standalone
// after
var target = BuildPipeline.GetBuildTargetByName(platformName);
if (IsStandaloneTarget(target))
path = ext.CalculateFinalPluginPath(platformName, imp);
else
path = nonDesktopExt.CalculateFinalPluginPath(platformName, imp); Defensive patterns
Strategy: validation
Validate before calling
var target = BuildPipeline.GetBuildTargetByName(platformName);
bool standalone = target == BuildTarget.StandaloneWindows || target == BuildTarget.StandaloneWindows64
|| target == BuildTarget.StandaloneOSX || target == BuildTarget.StandaloneLinux64;
if (!standalone) return string.Empty; // route to the correct extension instead Type guard
static bool IsStandaloneTarget(BuildTarget t) =>
t == BuildTarget.StandaloneWindows || t == BuildTarget.StandaloneWindows64 ||
t == BuildTarget.StandaloneOSX || t == BuildTarget.StandaloneLinux64 ||
t == BuildTarget.StandaloneLinuxUniversal; Try / catch
try { return ext.CalculateFinalPluginPath(platformName, imp); }
catch (Exception) { return string.Empty; /* non-standalone platform, no desktop path */ } Prevention
- Route plugin path calculation to the extension matching the target family (desktop/mobile/etc.).
- Validate the resolved BuildTarget is standalone before calling the desktop extension.
- After Unity upgrades, re-check deprecated target names (the source suppresses 612/618).
When it happens
Trigger: Calling CalculateFinalPluginPath with a platformName that resolves to a BuildTarget which is not StandaloneWindows/Windows64, StandaloneOSX (Intel/Intel64/universal), or StandaloneLinux/Linux64/LinuxUniversal/LinuxHeadlessSimulation. Also when BuildPipeline.GetBuildTargetByName returns an unexpected/None target for the string.
Common situations: A platform string from a non-desktop target (mobile, console, web) being routed through the desktop extension. A stale or renamed platform string after a Unity version upgrade (deprecated targets). Custom build pipeline code passing a display name instead of the internal platform name.
Related errors
- Platform does not implement DeploymentTargetsExtension
- Unexpected mixed value for '{assetPath}', platform: {platfor
- Unknown DesktopPluginCPUArchitecture value: {architecture}
- For the '{0}' target the 'locationPathName' parameter for Bu
- '{standaloneSubtarget}' is not a valid subtarget for the Sta
AI-assisted analysis of Unity-Technologies/UnityCsReference@225b0fbdb5 (2026-08-13).
Data as JSON: /api/errors/86ba5fd48a48657b.
Report an issue: GitHub.