{"record":{"id":"09a7cd4da15df2a3","repo":"EllanJiang/GameFramework","slug":"read-write-path-is-invalid-resourcemanager","errorCode":null,"errorMessage":"Read-write path is invalid.","messagePattern":"Read-write path is invalid\\.","errorType":"validation","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/Resource/ResourceManager.VersionListProcessor.cs","lineNumber":85,"sourceCode":"                {\n                    throw new GameFrameworkException(\"Download manager is invalid.\");\n                }\n\n                m_DownloadManager = downloadManager;\n                m_DownloadManager.DownloadSuccess += OnDownloadSuccess;\n                m_DownloadManager.DownloadFailure += OnDownloadFailure;\n            }\n\n            /// <summary>\n            /// 检查版本资源列表。\n            /// </summary>\n            /// <param name=\"latestInternalResourceVersion\">最新的内部资源版本号。</param>\n            /// <returns>检查版本资源列表结果。</returns>\n            public CheckVersionListResult CheckVersionList(int latestInternalResourceVersion)\n            {\n                if (string.IsNullOrEmpty(m_ResourceManager.m_ReadWritePath))\n                {\n                    throw new GameFrameworkException(\"Read-write path is invalid.\");\n                }\n\n                string versionListFileName = Utility.Path.GetRegularPath(Path.Combine(m_ResourceManager.m_ReadWritePath, RemoteVersionListFileName));\n                if (!File.Exists(versionListFileName))\n                {\n                    return CheckVersionListResult.NeedUpdate;\n                }\n\n                int internalResourceVersion = 0;\n                FileStream fileStream = null;\n                try\n                {\n                    fileStream = new FileStream(versionListFileName, FileMode.Open, FileAccess.Read);\n                    object internalResourceVersionObject = null;\n                    if (!m_ResourceManager.m_UpdatableVersionListSerializer.TryGetValue(fileStream, \"InternalResourceVersion\", out internalResourceVersionObject))\n                    {\n                        return CheckVersionListResult.NeedUpdate;\n                    }","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Resource/ResourceManager.VersionListProcessor.cs#L67-L103","documentation":"VersionListProcessor.CheckVersionList throws this when the ResourceManager's read-write path (m_ReadWritePath) is null or empty. The check reads the remote/local version list file from Path.Combine(readWritePath, RemoteVersionListFileName) and compares it against the latest internal resource version, which is impossible without a path.","triggerScenarios":"Calling CheckVersionList before ReadWritePath has been assigned on the ResourceManager, or after it was set to an empty string.","commonSituations":"Bootstrap code that calls the check-versions flow before path configuration; paths set only for some build targets; config load failure leaving the path empty.","solutions":["Assign ResourceManager.ReadWritePath before invoking the version-list check.","Log/verify the path value right before the check to catch empty-path configuration early.","Move path initialization to the earliest startup point (before CheckVersionList / UpdateResource flow begins)."],"exampleFix":"// before\nvar result = m_ResourceManager.CheckVersionList(latestVersion); // path unset\n// after\nm_ResourceManager.ReadWritePath = Utility.Path.GetRegularPath(Application.persistentDataPath);\nvar result = m_ResourceManager.CheckVersionList(latestVersion);","handlingStrategy":"validation","validationCode":"// C#\nif (string.IsNullOrEmpty(m_ResourceManager.ReadWritePath))\n{\n    m_ResourceManager.ReadWritePath = Utility.Path.GetRegularPath(Application.persistentDataPath);\n}\nvar result = m_ResourceManager.CheckVersionList(latestVersion);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Assign ReadWritePath before any version checking begins.","Log the path at bootstrap so silent empty-path configs are visible.","Fail fast in config loading if the read-write path resolves to empty."],"tags":["gameframework","version-list","missing-config","read-write-path"],"backgroundTag":"missing-required-config-field","analyzedSha":"d0c010b05167c58e92350449d04864a91ca13fd2","analyzedAt":"2026-09-15T13:37:15.352Z","contentChangedAt":"2026-09-15T13:37:15.352Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}