Unity-Technologies/UnityCsReference · error · NotSupportedException
Unknown DesktopPluginCPUArchitecture value: {architecture}
Error message
Unknown DesktopPluginCPUArchitecture value: {architecture} What it means
GetCPUString switches over DesktopPluginCPUArchitecture and the default arm throws NotSupportedException for an unhandled enum value. This is a defensive exhaustive-switch guard: every defined architecture (None, x86, x86_64, ARM64, AnyCPU) has a case, so reaching default implies an enum value the editor build does not know about.
Source
Thrown at Editor/Mono/ImportSettings/DesktopPluginImporterExtension.cs:374
switch (architecture)
{
case DesktopPluginCPUArchitecture.None :
return "None";
case DesktopPluginCPUArchitecture.x86 :
return buildTarget == BuildTarget.StandaloneOSX ? "Intel 32-bit" : "x86";
case DesktopPluginCPUArchitecture.x86_64:
return buildTarget == BuildTarget.StandaloneOSX ? "Intel 64-bit" : "x64";
case DesktopPluginCPUArchitecture.ARM64:
return buildTarget == BuildTarget.StandaloneOSX ? "Apple silicon" : "ARM64";
case DesktopPluginCPUArchitecture.AnyCPU:
return "Any CPU";
default:
throw new NotSupportedException("Unknown DesktopPluginCPUArchitecture value: " + architecture);
}
}
}
}
View on GitHub (pinned to 225b0fbdb5)
Solutions
- Re-open the project in the Unity version that wrote the plugin asset, or upgrade the editor to the version that introduced the new enum member.
- Reset the plugin's CPU architecture in the inspector to a known value (AnyCPU/x86_64) and re-save.
- Reimport the plugin to re-derive a valid architecture from its binary metadata.
- If authoring a fork, add a case for the new enum value in GetCPUString.
Example fix
// before: serialized enum value unknown to this editor -> default throws // after: reset to a known architecture via inspector or imp.SetPlatformData(platformName, cpuKey, nameof(DesktopPluginCPUArchitecture.x86_64));
Defensive patterns
Strategy: type-guard
Validate before calling
if (!Enum.IsDefined(typeof(DesktopPluginCPUArchitecture), architecture))
architecture = DesktopPluginCPUArchitecture.AnyCPU; // or reject Type guard
static bool IsKnown(DesktopPluginCPUArchitecture a) =>
a == DesktopPluginCPUArchitecture.None || a == DesktopPluginCPUArchitecture.x86 ||
a == DesktopPluginCPUArchitecture.x86_64 || a == DesktopPluginCPUArchitecture.ARM64 ||
a == DesktopPluginCPUArchitecture.AnyCPU; Prevention
- Reimport plugins serialized by a different Unity version rather than editing enum data by hand.
- When extending the enum in a fork, update every switch (GetCPUString and siblings) atomically.
- Validate enum values with Enum.IsDefined before passing to CPU-string resolvers.
When it happens
Trigger: A DesktopPluginCPUArchitecture value not covered by any case reaches the switch — typically a value from a newer/different Unity version or a deserialized/corrupted enum value that is numerically outside the known set.
Common situations: Loading a project or plugin asset whose serialized CPU architecture enum was written by a newer Unity version that added a member (e.g. a new ARM variant). Manually editing serialized plugin data. Version skew between the editor and an asset imported elsewhere.
Related errors
- Unknown EditorPluginCPUArchitecture value: {architecture}
- Unexpected mixed value for '{assetPath}', platform: {platfor
- Failed to resolve standalone platform, platform string '{0}'
- Unknown opt out decision type
- Unknown dialog icon type
AI-assisted analysis of Unity-Technologies/UnityCsReference@225b0fbdb5 (2026-08-13).
Data as JSON: /api/errors/9124873ebfbd6498.
Report an issue: GitHub.