{"record":{"id":"2a267585919fbfb5","repo":"EllanJiang/GameFramework","slug":"read-write-path-is-invalid-resourcemanager-resourceverifier","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.ResourceVerifier.cs","lineNumber":140,"sourceCode":"            /// <summary>\n            /// 校验资源。\n            /// </summary>\n            /// <param name=\"verifyResourceLengthPerFrame\">每帧至少校验资源的大小，以字节为单位。</param>\n            public void VerifyResources(int verifyResourceLengthPerFrame)\n            {\n                if (verifyResourceLengthPerFrame < 0)\n                {\n                    throw new GameFrameworkException(\"Verify resource count per frame is invalid.\");\n                }\n\n                if (m_ResourceManager.m_ResourceHelper == null)\n                {\n                    throw new GameFrameworkException(\"Resource helper is invalid.\");\n                }\n\n                if (string.IsNullOrEmpty(m_ResourceManager.m_ReadWritePath))\n                {\n                    throw new GameFrameworkException(\"Read-write path is invalid.\");\n                }\n\n                m_VerifyResourceLengthPerFrame = verifyResourceLengthPerFrame;\n                m_ResourceManager.m_ResourceHelper.LoadBytes(Utility.Path.GetRemotePath(Path.Combine(m_ResourceManager.m_ReadWritePath, LocalVersionListFileName)), new LoadBytesCallbacks(OnLoadReadWriteVersionListSuccess, OnLoadReadWriteVersionListFailure), null);\n            }\n\n            private bool VerifyResource(VerifyInfo verifyInfo)\n            {\n                if (verifyInfo.UseFileSystem)\n                {\n                    IFileSystem fileSystem = m_ResourceManager.GetFileSystem(verifyInfo.FileSystemName, false);\n                    string fileName = verifyInfo.ResourceName.FullName;\n                    FileSystem.FileInfo fileInfo = fileSystem.GetFileInfo(fileName);\n                    if (!fileInfo.IsValid)\n                    {\n                        return false;\n                    }\n","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Resource/ResourceManager.ResourceVerifier.cs#L122-L158","documentation":"ResourceVerifier.VerifyResources throws this when the ResourceManager's read-write path (m_ReadWritePath) is null or empty. The verifier reads the local version list from Path.Combine(readWritePath, LocalVersionListFileName), so a missing path means it cannot locate the file.","triggerScenarios":"Calling VerifyResources before ReadWritePath was set on the ResourceManager (e.g. never assigned, or assigned after verification starts).","commonSituations":"Platform startup code that sets ReadWritePath conditionally and skips a platform; setting ReadWritePath on the wrapper after triggering verify; fresh installs where path initialization was forgotten.","solutions":["Set ResourceManager.ReadWritePath to a valid writable directory before calling VerifyResources.","Use Utility.Path.GetRegularPath / platform-appropriate persistent data path (e.g. Application.persistentDataPath) at startup.","Assert ReadWritePath is non-empty in your bootstrap before starting the verify/update pipeline."],"exampleFix":"// before\nm_ResourceManager.VerifyResources(1024 * 1024); // ReadWritePath unset\n// after\nm_ResourceManager.ReadWritePath = Utility.Path.GetRegularPath(Application.persistentDataPath);\nm_ResourceManager.VerifyResources(1024 * 1024);","handlingStrategy":"validation","validationCode":"// C#\nif (string.IsNullOrEmpty(m_ResourceManager.ReadWritePath))\n{\n    m_ResourceManager.ReadWritePath = Utility.Path.GetRegularPath(Application.persistentDataPath);\n}\nm_ResourceManager.VerifyResources(1024 * 1024);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set ReadWritePath unconditionally at startup for every build target.","Assert the path is non-empty in your bootstrap before starting check/verify/update flows.","Do not make path assignment conditional on optional config values."],"tags":["gameframework","resource-verifier","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"}