{"record":{"id":"009648db596f0c65","repo":"Unity-Technologies/UnityCsReference","slug":"could-not-find-isreadable-property-in-the-meta-fil","errorCode":null,"errorMessage":"Could not find isReadable property in the meta file","messagePattern":"Could not find isReadable property in the meta file","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"Editor/Mono/InternalEditorUtility.bindings.cs","lineNumber":442,"sourceCode":"            for (int i = 0; i < lines.Length; i++)\n            {\n                // Look for the isReadable property line\n                if (Regex.IsMatch(lines[i], @\"^\\s*isReadable:\\s*\\d+\\s*$\"))\n                {\n                    // Replace with isReadable: 1, preserving original indentation\n                    var match = Regex.Match(lines[i], @\"^(\\s*)isReadable:\\s*\\d+(\\s*)$\");\n                    if (match.Success)\n                    {\n                        lines[i] = $\"{match.Groups[1].Value}isReadable: 1{match.Groups[2].Value}\";\n                        modified = true;\n                        break;\n                    }\n                }\n            }\n\n            if (!modified)\n            {\n                throw new InvalidOperationException(\"Could not find isReadable property in the meta file\");\n            }\n\n            // Write back to file\n            File.WriteAllLines(metaFilePath, lines, Encoding.UTF8);\n        }\n\n        internal static void SetTextureReadableByAssetPath(string textureAssetPath)\n        {\n            string metaFilePath = textureAssetPath + \".meta\";\n            SetTextureReadable(metaFilePath);\n            AssetDatabase.ImportAsset(textureAssetPath);\n        }\n\n        [FreeFunction(\"InternalEditorUtilityBindings::GetEditorAssemblyPath\")]\n        public extern static string GetEditorAssemblyPath();\n\n        [FreeFunction(\"InternalEditorUtilityBindings::GetEngineAssemblyPath\")]\n        public extern static string GetEngineAssemblyPath();","sourceCodeStart":424,"sourceCodeEnd":460,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/InternalEditorUtility.bindings.cs#L424-L460","documentation":"Thrown after SetTextureReadable reads every line of a texture .meta file and finds no line matching the isReadable property regex (a 'isReadable: <digit>' line). It means the meta file exists but its contents are not the expected Unity meta format, so the property cannot be located and rewritten.","triggerScenarios":"Calling SetTextureReadable on a meta file that is empty, truncated, hand-edited, from a very old Unity version that used a different textureImporterSettings layout, or that belongs to a non-texture asset (the isReadable setting is specific to TextureImporter).","commonSituations":"Passing the meta file of a non-texture asset (material, script, audio) which has no isReadable field. Corrupted or partially-written meta files from a crash or a bad VCS merge. Meta files produced by a much newer/older Unity major version with a different importer schema.","solutions":["Confirm the meta file belongs to an actual texture asset and not another asset type.","Open the meta file and check that a line like 'isReadable: 0' exists; if missing or malformed, delete the .meta and let Unity re-import the texture to regenerate it.","Upgrade or repair the meta file by forcing a reimport: AssetDatabase.ImportAsset with ImportAssetOptions.ForceUpdate."],"exampleFix":"// before\nInternalEditorUtility.SetTextureReadable(metaFilePath);\n\n// after\nvar lines = File.ReadAllLines(metaFilePath);\nif (!lines.Any(l => Regex.IsMatch(l, @\"^\\s*isReadable:\\s*\\d+\\s*$\")))\n    AssetDatabase.ImportAsset(assetPath, ImportAssetOptions.ForceUpdate);\nInternalEditorUtility.SetTextureReadable(metaFilePath);","handlingStrategy":"validation","validationCode":"var lines = File.ReadAllLines(metaFilePath);\nbool hasReadable = System.Array.FindIndex(lines, l => System.Text.RegularExpressions.Regex.IsMatch(l, @\"^\\s*isReadable:\\s*\\d+\\s*$\")) >= 0;\nif (!hasReadable) { AssetDatabase.ImportAsset(assetPath, ImportAssetOptions.ForceUpdate); }","typeGuard":null,"tryCatchPattern":"try { SetTextureReadable(metaFilePath); }\ncatch (InvalidOperationException) { AssetDatabase.ImportAsset(assetPath, ImportAssetOptions.ForceUpdate); SetTextureReadable(metaFilePath); }","preventionTips":["Confirm the meta file belongs to a texture","Force-reimport to repair malformed meta","Validate the isReadable line exists before editing"],"tags":["unity","editor","texture","meta-file","importer"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}