EllanJiang/GameFramework · error · GameFrameworkException
Read-write path is invalid.
Error message
Read-write path is invalid.
What it means
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.
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.
Example fix
// before m_ResourceManager.VerifyResources(1024 * 1024); // ReadWritePath unset // after m_ResourceManager.ReadWritePath = Utility.Path.GetRegularPath(Application.persistentDataPath); m_ResourceManager.VerifyResources(1024 * 1024);
Defensive patterns
Strategy: validation
Validate before calling
// C#
if (string.IsNullOrEmpty(m_ResourceManager.ReadWritePath))
{
m_ResourceManager.ReadWritePath = Utility.Path.GetRegularPath(Application.persistentDataPath);
}
m_ResourceManager.VerifyResources(1024 * 1024); Prevention
- 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.
When it happens
Trigger: Calling VerifyResources before ReadWritePath was set on the ResourceManager (e.g. never assigned, or assigned after verification starts).
Common situations: 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.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- Read-write path is invalid.
- Verify resource count per frame is invalid.
- Resource helper is invalid.
- Resource manager is invalid.
- Data provider helper is invalid.
AI-assisted analysis of EllanJiang/GameFramework@d0c010b051 (2026-09-15).
Data as JSON: /api/errors/2a267585919fbfb5.
Report an issue: GitHub.
Appendix: source
Thrown at GameFramework/Resource/ResourceManager.ResourceVerifier.cs:140
/// <summary>
/// 校验资源。
/// </summary>
/// <param name="verifyResourceLengthPerFrame">每帧至少校验资源的大小,以字节为单位。</param>
public void VerifyResources(int verifyResourceLengthPerFrame)
{
if (verifyResourceLengthPerFrame < 0)
{
throw new GameFrameworkException("Verify resource count per frame is invalid.");
}
if (m_ResourceManager.m_ResourceHelper == null)
{
throw new GameFrameworkException("Resource helper is invalid.");
}
if (string.IsNullOrEmpty(m_ResourceManager.m_ReadWritePath))
{
throw new GameFrameworkException("Read-write path is invalid.");
}
m_VerifyResourceLengthPerFrame = verifyResourceLengthPerFrame;
m_ResourceManager.m_ResourceHelper.LoadBytes(Utility.Path.GetRemotePath(Path.Combine(m_ResourceManager.m_ReadWritePath, LocalVersionListFileName)), new LoadBytesCallbacks(OnLoadReadWriteVersionListSuccess, OnLoadReadWriteVersionListFailure), null);
}
private bool VerifyResource(VerifyInfo verifyInfo)
{
if (verifyInfo.UseFileSystem)
{
IFileSystem fileSystem = m_ResourceManager.GetFileSystem(verifyInfo.FileSystemName, false);
string fileName = verifyInfo.ResourceName.FullName;
FileSystem.FileInfo fileInfo = fileSystem.GetFileInfo(fileName);
if (!fileInfo.IsValid)
{
return false;
}
View on GitHub (pinned to d0c010b051)