EllanJiang/GameFramework · error · GameFrameworkException

Can not load binary ' ' from file system which is not ready.

Error message

Can not load binary '{0}' from file system which is not ready.

What it means

LoadBinaryFromFileSystem found the ResourceInfo but resourceInfo.Ready is false — the resource is registered but not yet present locally (still updating). The synchronous file-system read cannot proceed, so it throws a GameFrameworkException.

Solutions

  1. Defer the call until the ResourceComponent signals all resources updated/ready.
  2. Poll or await readiness (e.g. check resource state) before reading from the file system.
  3. If the update failed, restart UpdateResources and retry once Ready becomes true.
  4. Wrap in try-catch on GameFrameworkException and fall back to async LoadBinary once update completes.

Example fix

// before
byte[] bytes = m_ResourceComponent.LoadBinaryFromFileSystem(binaryName); // during hot-update
// after
m_ResourceComponent.ResourceUpdateAllComplete += () =>
{
    byte[] bytes = m_ResourceComponent.LoadBinaryFromFileSystem(binaryName);
};
Defensive patterns

Strategy: retry

Validate before calling

if (!m_ResourceComponent.IsResourceAllReady)
{
    m_ResourceComponent.ResourceUpdateAllComplete += () => ReadBinary(binaryName);
    return;
}

Type guard

bool IsResourceReady(ResourceComponent rc, string name) => rc != null && rc.IsResourceAllReady;

Try / catch

try { bytes = m_ResourceComponent.LoadBinaryFromFileSystem(binaryName); }
catch (GameFrameworkException ex) when (ex.Message.Contains("not ready"))
{ DeferUntilUpdateComplete(() => ReadBinary(binaryName)); }

Prevention

When it happens

Trigger: Calling LoadBinaryFromFileSystem during an in-progress resource update in updatable mode, or after a failed/interrupted download left the resource NotReady.

Common situations: Hot-update not finished when gameplay requests the binary; network interruption during update; starting loads immediately after app launch before CheckVersion/UpdateResources completes.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


AI-assisted analysis of EllanJiang/GameFramework@d0c010b051 (2026-09-15). Data as JSON: /api/errors/9c17724335d34355. Report an issue: GitHub.

Appendix: source

Thrown at GameFramework/Resource/ResourceManager.ResourceLoader.cs:628

                }
            }

            /// <summary>
            /// 从文件系统中加载二进制资源。
            /// </summary>
            /// <param name="binaryAssetName">要加载二进制资源的名称。</param>
            /// <returns>存储加载二进制资源的二进制流。</returns>
            public byte[] LoadBinaryFromFileSystem(string binaryAssetName)
            {
                ResourceInfo resourceInfo = GetResourceInfo(binaryAssetName);
                if (resourceInfo == null)
                {
                    throw new GameFrameworkException(Utility.Text.Format("Can not load binary '{0}' from file system which is not exist.", binaryAssetName));
                }

                if (!resourceInfo.Ready)
                {
                    throw new GameFrameworkException(Utility.Text.Format("Can not load binary '{0}' from file system which is not ready.", binaryAssetName));
                }

                if (!resourceInfo.IsLoadFromBinary)
                {
                    throw new GameFrameworkException(Utility.Text.Format("Can not load binary '{0}' from file system which is not a binary asset.", binaryAssetName));
                }

                if (!resourceInfo.UseFileSystem)
                {
                    throw new GameFrameworkException(Utility.Text.Format("Can not load binary '{0}' from file system which is not use file system.", binaryAssetName));
                }

                IFileSystem fileSystem = m_ResourceManager.GetFileSystem(resourceInfo.FileSystemName, resourceInfo.StorageInReadOnly);
                byte[] bytes = fileSystem.ReadFile(resourceInfo.ResourceName.FullName);
                if (bytes == null)
                {
                    return null;
                }

View on GitHub (pinned to d0c010b051)