Unity-Technologies/UnityCsReference · error · NotSupportedException
Unknown EditorPluginCPUArchitecture value: {architecture}
Error message
Unknown EditorPluginCPUArchitecture value: {architecture} What it means
Mirrors error 343 but for EditorPluginCPUArchitecture. The switch handles x86_64, ARM64, and AnyCPU; the default branch throws NotSupportedException for an unrecognized value. Editor plugins run in the editor process, so this enum is narrower than the desktop player one.
Source
Thrown at Editor/Mono/ImportSettings/EditorPluginImporterExtension.cs:132
currentOS = osValue;
}
}
static string GetArchitectureName(EditorPluginOSArchitecture os, EditorPluginCPUArchitecture architecture)
{
switch (architecture)
{
case EditorPluginCPUArchitecture.x86_64:
return os == EditorPluginOSArchitecture.OSX ? "Intel 64-bit" : "x64";
case EditorPluginCPUArchitecture.ARM64:
return os == EditorPluginOSArchitecture.OSX ? "Apple silicon" : "Arm64";
case EditorPluginCPUArchitecture.AnyCPU:
return "Any CPU";
default:
throw new NotSupportedException("Unknown EditorPluginCPUArchitecture value: " + architecture);
}
}
}
private CPUProperty editorCPUProperty;
private EditorProperty editorOSProperty;
public EditorPluginImporterExtension() : base(null)
{
editorCPUProperty = new CPUProperty(EditorGUIUtility.TrTextContent("CPU", "The processor architectiure that this plugin is compatible with"), "CPU", EditorPluginCPUArchitecture.AnyCPU, (Enum e) => CanSelectArch(e));
editorOSProperty = new EditorProperty(EditorGUIUtility.TrTextContent("OS", "The Editor operating system that this plugin is compatible with"), "OS", EditorPluginOSArchitecture.AnyOS);
properties = new Property[] { editorOSProperty, editorCPUProperty };
}
public override void OnPlatformSettingsGUI(PluginImporterInspector inspector)
{
EditorGUI.BeginChangeCheck();View on GitHub (pinned to 225b0fbdb5)
Solutions
- Reimport the editor plugin so its architecture is re-detected for the current host.
- Reset the OS/CPU compatibility in the plugin inspector to AnyCPU and reapply.
- Upgrade/downgrade to match the Unity version that produced the asset.
- In a fork, extend the switch to cover the additional enum member.
Example fix
// before: unknown EditorPluginCPUArchitecture -> default throws
// after
imp.SetPlatformData("Editor", "CPU", nameof(EditorPluginCPUArchitecture.AnyCPU)); Defensive patterns
Strategy: type-guard
Validate before calling
if (!Enum.IsDefined(typeof(EditorPluginCPUArchitecture), architecture))
architecture = EditorPluginCPUArchitecture.AnyCPU; Type guard
static bool IsKnown(EditorPluginCPUArchitecture a) =>
a == EditorPluginCPUArchitecture.x86_64 || a == EditorPluginCPUArchitecture.ARM64 ||
a == EditorPluginCPUArchitecture.AnyCPU; Prevention
- Reset editor-plugin CPU to AnyCPU when opening a project from a mismatched Unity version.
- Reimport editor plugins so architecture is re-detected for the host.
- Extend the switch when adding enum members in a fork.
When it happens
Trigger: An EditorPluginCPUArchitecture value outside {x86_64, ARM64, AnyCPU} is deserialized or passed into the CPU label resolver — e.g. a value from a different/newer Unity or a corrupted serialized state.
Common situations: Opening a project on an editor whose host-architecture enum differs (e.g. a build that dropped x86 support). Stale serialized editor-plugin compatibility data after an upgrade.
Related errors
- Unknown DesktopPluginCPUArchitecture value: {architecture}
- Unknown opt out decision type
- Unknown dialog icon type
- Parameter enumValue must be of type System.Enum
- Value for parameter atlases is null
AI-assisted analysis of Unity-Technologies/UnityCsReference@225b0fbdb5 (2026-08-13).
Data as JSON: /api/errors/2c6288ed458cb884.
Report an issue: GitHub.