Unity-Technologies/UnityCsReference · error · UnityException

Cannot find any Platform Settings, including the Default Pla

Error message

Cannot find any Platform Settings, including the Default Platform. This is incorrect, please report a bug.

What it means

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.

Source

Thrown at Editor/Mono/ImportSettings/TextureImportPlatformSettings.cs:600

            if (platformSettingsArray.hasMultipleDifferentValues)
            {
                ResetSerializedProperties();
                return;
            }

            if (model.platformTextureSettingsProp != null && model.platformTextureSettingsProp.isValid &&
                model.platformTextureSettingsProp.FindPropertyRelative("m_BuildTarget").stringValue == model.platformTextureSettings.name)
            {
                return; // We've already cached the appropriate PlatformTextureSettings property, don't update.
            }

            // Below: retrieve the appropriate properties for the chosen BuildTarget.
            if (platformSettingsArray.arraySize <= 0)
            {
                // This should not happen, all known valid platforms should have
                // been created in advance, including the Default Platform.
                ResetSerializedProperties();
                throw new UnityException("Cannot find any Platform Settings, including the Default Platform. This is incorrect, please report a bug.");
            }
            else
            {
                // Fetch the matching platform settings property.
                // Do not skip element 0, the Default Platform is a valid choice.
                for (int i = 0; i < platformSettingsArray.arraySize; ++i)
                {
                    SerializedProperty serializedProperty = platformSettingsArray.GetArrayElementAtIndex(i);
                    if (serializedProperty.FindPropertyRelative("m_BuildTarget").stringValue == model.platformTextureSettings.name)
                    {
                        model.platformTextureSettingsProp = serializedProperty;
                        break;
                    }
                }

                // Since we ensure that all known valid platforms are created in advance,
                // we should be able to find the currently selected platform. If not, fail.
                if (model.platformTextureSettingsProp is null)

View on GitHub (pinned to 225b0fbdb5)

Solutions

  1. Reimport the texture (AssetDatabase.Reimport or right-click Reimport) so the importer rebuilds the platform settings array with the Default Platform.
  2. Delete the texture's .meta file and reimport to regenerate clean platform settings.
  3. If a custom AssetPostprocessor is stripping m_PlatformSettings, fix it to preserve/seed the array.
  4. Report a bug if it reproduces on a stock asset with no custom postprocessors.

Example fix

// before: corrupted/empty m_PlatformSettings -> UnityException on inspector open

// after
AssetDatabase.ImportAsset(assetPath, ImportAssetOptions.ForceUpdate);
Defensive patterns

Strategy: try-catch

Validate before calling

// inspect the serialized array size before letting the inspector sync
var arr = serializedObject.FindProperty("m_PlatformSettings");
if (arr == null || arr.arraySize <= 0)
    AssetDatabase.ImportAsset(assetPath, ImportAssetOptions.ForceUpdate);

Try / catch

try { model.UpdateSerializedPropertyData(); }
catch (UnityException) { AssetDatabase.ImportAsset(model.assetPath, ImportAssetOptions.ForceUpdate); }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of Unity-Technologies/UnityCsReference@225b0fbdb5 (2026-08-13). Data as JSON: /api/errors/f74e424cc2602328. Report an issue: GitHub.