{"record":{"id":"f74e424cc2602328","repo":"Unity-Technologies/UnityCsReference","slug":"cannot-find-any-platform-settings-including-the-d","errorCode":null,"errorMessage":"Cannot find any Platform Settings, including the Default Platform. This is incorrect, please report a bug.","messagePattern":"Cannot find any Platform Settings, including the Default Platform\\. This is incorrect, please report a bug\\.","errorType":"exception","errorClass":"UnityException","httpStatus":null,"severity":"error","filePath":"Editor/Mono/ImportSettings/TextureImportPlatformSettings.cs","lineNumber":600,"sourceCode":"            if (platformSettingsArray.hasMultipleDifferentValues)\n            {\n                ResetSerializedProperties();\n                return;\n            }\n\n            if (model.platformTextureSettingsProp != null && model.platformTextureSettingsProp.isValid &&\n                model.platformTextureSettingsProp.FindPropertyRelative(\"m_BuildTarget\").stringValue == model.platformTextureSettings.name)\n            {\n                return; // We've already cached the appropriate PlatformTextureSettings property, don't update.\n            }\n\n            // Below: retrieve the appropriate properties for the chosen BuildTarget.\n            if (platformSettingsArray.arraySize <= 0)\n            {\n                // This should not happen, all known valid platforms should have\n                // been created in advance, including the Default Platform.\n                ResetSerializedProperties();\n                throw new UnityException(\"Cannot find any Platform Settings, including the Default Platform. This is incorrect, please report a bug.\");\n            }\n            else\n            {\n                // Fetch the matching platform settings property.\n                // Do not skip element 0, the Default Platform is a valid choice.\n                for (int i = 0; i < platformSettingsArray.arraySize; ++i)\n                {\n                    SerializedProperty serializedProperty = platformSettingsArray.GetArrayElementAtIndex(i);\n                    if (serializedProperty.FindPropertyRelative(\"m_BuildTarget\").stringValue == model.platformTextureSettings.name)\n                    {\n                        model.platformTextureSettingsProp = serializedProperty;\n                        break;\n                    }\n                }\n\n                // Since we ensure that all known valid platforms are created in advance,\n                // we should be able to find the currently selected platform. If not, fail.\n                if (model.platformTextureSettingsProp is null)","sourceCodeStart":582,"sourceCodeEnd":618,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/ImportSettings/TextureImportPlatformSettings.cs#L582-L618","documentation":"UpdateSerializedPropertyData expects the texture-importer's platform settings array to be non-empty because the importer is supposed to pre-create entries for all known platforms including the Default Platform. If platformSettingsArray.arraySize <= 0 it throws a UnityException, treating an empty array as a corrupt/invalid state that should be reported as a bug.","triggerScenarios":"The serialized 'm_PlatformSettings' array on a TextureImporter (or texture import settings object) is empty or failed to deserialize, so no Default Platform entry exists when the inspector tries to sync its cached property.","commonSituations":"Corrupted .meta or texture import settings after a crash or bad merge. A custom importer/asset postprocessor that clears or fails to populate m_PlatformSettings. Forcing import settings through serialized manipulation. Asset written by a much older Unity that lacked the Default Platform entry and not migrated.","solutions":["Reimport the texture (AssetDatabase.Reimport or right-click Reimport) so the importer rebuilds the platform settings array with the Default Platform.","Delete the texture's .meta file and reimport to regenerate clean platform settings.","If a custom AssetPostprocessor is stripping m_PlatformSettings, fix it to preserve/seed the array.","Report a bug if it reproduces on a stock asset with no custom postprocessors."],"exampleFix":"// before: corrupted/empty m_PlatformSettings -> UnityException on inspector open\n\n// after\nAssetDatabase.ImportAsset(assetPath, ImportAssetOptions.ForceUpdate);","handlingStrategy":"try-catch","validationCode":"// inspect the serialized array size before letting the inspector sync\nvar arr = serializedObject.FindProperty(\"m_PlatformSettings\");\nif (arr == null || arr.arraySize <= 0)\n    AssetDatabase.ImportAsset(assetPath, ImportAssetOptions.ForceUpdate);","typeGuard":null,"tryCatchPattern":"try { model.UpdateSerializedPropertyData(); }\ncatch (UnityException) { AssetDatabase.ImportAsset(model.assetPath, ImportAssetOptions.ForceUpdate); }","preventionTips":["Reimport textures after a crash or bad merge to rebuild platform settings.","Audit AssetPostprocessors that touch m_PlatformSettings to ensure they seed the Default Platform.","Avoid hand-editing serialized texture settings arrays."],"tags":["texture-importer","platform-settings","serialization","inspector","corruption"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}