Unity-Technologies/UnityCsReference · error · UnityException

Could not find the requested Platform Texture Settings ('{na

Error message

Could not find the requested Platform Texture Settings ('{name}'). This is incorrect, please report a bug.

What it means

After confirming the platform settings array is non-empty, the loop searches for an element whose m_BuildTarget matches the currently selected platform's name. If none matches, it throws UnityException because the contract guarantees every valid platform is pre-created; a missing entry means the selected platform is unknown or the array is inconsistent.

Source

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

            {
                // 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)
                {
                    ResetSerializedProperties();
                    throw new UnityException($"Could not find the requested Platform Texture Settings ('{model.platformTextureSettings.name}'). This is incorrect, please report a bug.");
                }
            }

            model.alphaSplitProperty = model.platformTextureSettingsProp.FindPropertyRelative("m_AllowsAlphaSplitting");
            model.androidETC2FallbackOverrideProperty = model.platformTextureSettingsProp.FindPropertyRelative("m_AndroidETC2FallbackOverride");
            model.compressionQualityProperty = model.platformTextureSettingsProp.FindPropertyRelative("m_CompressionQuality");
            model.crunchedCompressionProperty = model.platformTextureSettingsProp.FindPropertyRelative("m_CrunchedCompression");
            model.maxTextureSizeProperty = model.platformTextureSettingsProp.FindPropertyRelative("m_MaxTextureSize");
            model.overriddenProperty = model.platformTextureSettingsProp.FindPropertyRelative("m_Overridden");
            model.resizeAlgorithmProperty = model.platformTextureSettingsProp.FindPropertyRelative("m_ResizeAlgorithm");
            model.textureCompressionProperty = model.platformTextureSettingsProp.FindPropertyRelative("m_TextureCompression");
            model.textureFormatProperty = model.platformTextureSettingsProp.FindPropertyRelative("m_TextureFormat");
        }

        public override int GetTargetCount()
        {
            return m_Importers.Length;
        }

View on GitHub (pinned to 225b0fbdb5)

Solutions

  1. Reimport the texture so the importer seeds an entry for the selected platform.
  2. Confirm the platform name string used by the inspector matches the m_BuildTarget value exactly (the comparison is ordinal, case-sensitive).
  3. Switch to a different platform and back in the inspector to force re-resolution.
  4. Delete and regenerate the .meta file if the platform list is permanently out of sync.

Example fix

// before: selected platform absent from m_PlatformSettings -> UnityException

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

Strategy: try-catch

Validate before calling

// confirm the selected platform exists in the array before syncing
bool found = false;
for (int i = 0; i < platformSettingsArray.arraySize; i++)
    if (platformSettingsArray.GetArrayElementAtIndex(i).FindPropertyRelative("m_BuildTarget").stringValue == model.platformTextureSettings.name)
        found = true;
if (!found) AssetDatabase.ImportAsset(model.assetPath, ImportAssetOptions.ForceUpdate);

Try / catch

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

Prevention

When it happens

Trigger: The platformTextureSettings.name (selected platform) has no matching m_BuildTarget string among the array elements — e.g. the selected platform was never added, the name string differs (case/format), or the array contains a stale/renamed set of platforms.

Common situations: A new BuildTarget added to the editor but not seeded into an existing texture asset's settings. Renamed platform display strings after upgrade. A custom platform whose name doesn't match what the texture importer registered. Editing import settings right after a platform list refresh.

Related errors


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