{"record":{"id":"dd7f9e578c80e13f","repo":"Unity-Technologies/UnityCsReference","slug":"unexpected-mixed-value-for-assetpath-platform","errorCode":null,"errorMessage":"Unexpected mixed value for '{assetPath}', platform: {platformName}","messagePattern":"Unexpected mixed value for '(.+?)', platform: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"Editor/Mono/ImportSettings/DesktopPluginImporterExtension.cs","lineNumber":43,"sourceCode":"        }\n\n        internal class DesktopSingleCPUProperty : Property\n        {\n            public DesktopSingleCPUProperty(BuildTarget buildTarget, DesktopPluginCPUArchitecture architecture)\n                : base(EditorGUIUtility.TrTextContent(GetArchitectureNameInGUI(buildTarget, architecture)), cpuKey, architecture, BuildPipeline.GetBuildTargetName(buildTarget))\n            {\n            }\n\n            public DesktopSingleCPUProperty(GUIContent name, BuildTarget buildTarget)\n                : base(name, cpuKey, DesktopPluginCPUArchitecture.AnyCPU, BuildPipeline.GetBuildTargetName(buildTarget))\n            {\n            }\n\n            internal bool IsTargetEnabled(PluginImporterInspector inspector)\n            {\n                PluginImporterInspector.Compatibility compatibililty = inspector.GetPlatformCompatibility(platformName);\n                if (compatibililty == PluginImporterInspector.Compatibility.Mixed)\n                    throw new Exception(\"Unexpected mixed value for '\" + inspector.importer.assetPath + \"', platform: \" + platformName);\n                if (compatibililty != PluginImporterInspector.Compatibility.Compatible)\n                    return false;\n\n                var pluginCPU = value as DesktopPluginCPUArchitecture ? ?? DesktopPluginCPUArchitecture.None;\n                return pluginCPU == (DesktopPluginCPUArchitecture)defaultValue || pluginCPU == DesktopPluginCPUArchitecture.AnyCPU;\n            }\n\n            internal override void OnGUI(PluginImporterInspector inspector)\n            {\n                EditorGUILayout.BeginHorizontal();\n                GUILayout.Space(10);\n                EditorGUI.BeginChangeCheck();\n\n                // This toggle controls two things:\n                // * Is platform enabled/disabled?\n                // * Platform CPU value\n                bool isTargetEnabled = EditorGUILayout.Toggle(name, IsTargetEnabled(inspector));\n                if (EditorGUI.EndChangeCheck())","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/ImportSettings/DesktopPluginImporterExtension.cs#L25-L61","documentation":"Thrown inside DesktopSingleCPUProperty.IsTargetEnabled when PluginImporterInspector.GetPlatformCompatibility returns Compatibility.Mixed. 'Mixed' means different selected plugins disagree on compatibility for that platform, which the single-CPU property logic cannot resolve into a single enabled/disabled answer, so it treats it as an unexpected (buggy) state rather than a silent default.","triggerScenarios":"Opening the PluginImporterInspector while multiple plugin assets are selected (multi-object editing) and those plugins report different per-platform compatibility for the same desktop platform string, yielding Compatibility.Mixed.","commonSituations":"Multi-selecting two or more native plugin files whose per-platform enable flags differ. A serialization or import-state inconsistency where one plugin is marked Compatible and another NotCompatible for the same BuildTarget. Editor code paths that build a mixed selection and force the inspector to evaluate CPU enablement.","solutions":["Select a single plugin asset instead of a multi-selection when adjusting per-platform CPU compatibility.","Re-import the affected plugins (Reimport) to refresh their serialized compatibility state so it is no longer Mixed.","Verify all selected plugins share the same platform compatibility before editing; align them via the inspector for one asset at a time.","If it reproduces on a clean selection, file a Unity bug — the comment framing implies Mixed should have been normalized upstream."],"exampleFix":"// before: multi-select plugins with differing compatibility -> inspector throws\n\n// after: select one plugin, or align compatibility first\nforeach (var p in selectedPlugins) p.SetCompatibleWithPlatform(platformName, desired);","handlingStrategy":"validation","validationCode":"// avoid driving IsTargetEnabled on a mixed selection\nvar compat = inspector.GetPlatformCompatibility(platformName);\nif (compat == PluginImporterInspector.Compatibility.Mixed)\n    return false; // or prompt user to single-select\n// safe to call IsTargetEnabled-equivalent logic now","typeGuard":null,"tryCatchPattern":"try { enabled = cpuProp.IsTargetEnabled(inspector); }\ncatch (Exception) { enabled = false; /* mixed/invalid compatibility, skip */ }","preventionTips":["Do not multi-select plugins whose platform compatibility differs when editing CPU settings.","Normalize compatibility across the selection before opening CPU controls.","Reimport plugins whose compatibility state looks inconsistent."],"tags":["plugin-importer","inspector","mixed-value","multi-object","desktop"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}