{"record":{"id":"a7710210269dd47b","repo":"EllanJiang/GameFramework","slug":"can-not-load-binary-0-which-is-not-ready","errorCode":null,"errorMessage":"Can not load binary '{0}' which is not ready.","messagePattern":"Can not load binary '(.+?)' which is not ready\\.","errorType":"exception","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/Resource/ResourceManager.ResourceLoader.cs","lineNumber":587,"sourceCode":"                    if (loadBinaryCallbacks.LoadBinaryFailureCallback != null)\n                    {\n                        loadBinaryCallbacks.LoadBinaryFailureCallback(binaryAssetName, LoadResourceStatus.NotExist, errorMessage, userData);\n                        return;\n                    }\n\n                    throw new GameFrameworkException(errorMessage);\n                }\n\n                if (!resourceInfo.Ready)\n                {\n                    string errorMessage = Utility.Text.Format(\"Can not load binary '{0}' which is not ready.\", binaryAssetName);\n                    if (loadBinaryCallbacks.LoadBinaryFailureCallback != null)\n                    {\n                        loadBinaryCallbacks.LoadBinaryFailureCallback(binaryAssetName, LoadResourceStatus.NotReady, errorMessage, userData);\n                        return;\n                    }\n\n                    throw new GameFrameworkException(errorMessage);\n                }\n\n                if (!resourceInfo.IsLoadFromBinary)\n                {\n                    string errorMessage = Utility.Text.Format(\"Can not load binary '{0}' which is not a binary asset.\", binaryAssetName);\n                    if (loadBinaryCallbacks.LoadBinaryFailureCallback != null)\n                    {\n                        loadBinaryCallbacks.LoadBinaryFailureCallback(binaryAssetName, LoadResourceStatus.TypeError, errorMessage, userData);\n                        return;\n                    }\n\n                    throw new GameFrameworkException(errorMessage);\n                }\n\n                if (resourceInfo.UseFileSystem)\n                {\n                    loadBinaryCallbacks.LoadBinarySuccessCallback(binaryAssetName, LoadBinaryFromFileSystem(binaryAssetName), 0f, userData);\n                }","sourceCodeStart":569,"sourceCodeEnd":605,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Resource/ResourceManager.ResourceLoader.cs#L569-L605","documentation":"The binary asset name exists in the resource index, but its ResourceInfo.Ready is false — the resource has not been downloaded/copied to a usable local location yet. LoadBinary only serves resources that are fully available; when no LoadBinaryFailureCallback is supplied it throws.","triggerScenarios":"Calling LoadBinary while the resource is still being downloaded in an updatable resource mode (single/multi variant update in progress), or before CheckVersion/UpdateResource completes; also when update failed silently and Ready never became true.","commonSituations":"Hot-update flow where game logic loads a binary before the ResourceComponent reports all resources updated; weak network leaving the resource in NotReady; user skipping update and directly requesting a remote binary.","solutions":["Wait for resource update completion (subscribe to ResourceComponent's update events / wait until UpdateResources finishes) before calling LoadBinary.","Check HasAsset/asset readiness before loading, and schedule the load after the resource becomes Ready.","Verify the resource update did not fail (check update error events) and retry the update if it did.","Provide a LoadBinaryFailureCallback so NotReady failures are reported gracefully instead of throwing."],"exampleFix":"// before\nm_ResourceComponent.LoadBinary(binaryName, callbacks, userData); // called before hot-update finishes\n// after\nm_ResourceComponent.ResourceUpdateAllComplete += () => m_ResourceComponent.LoadBinary(binaryName, callbacks, userData);","handlingStrategy":"retry","validationCode":"// only load once resource update has finished\nif (!m_ResourceComponent.IsResourceAllReady)\n{\n    pendingLoads.Enqueue(binaryName); // replay after ResourceUpdateAllComplete\n    return;\n}\nm_ResourceComponent.LoadBinary(binaryName, callbacks, userData);","typeGuard":"bool IsReadyToLoad(ResourceComponent rc) => rc != null && rc.IsResourceAllReady;","tryCatchPattern":"try { m_ResourceComponent.LoadBinary(binaryName, callbacks, userData); }\ncatch (GameFrameworkException ex) when (ex.Message.Contains(\"which is not ready\"))\n{ RetryAfterUpdateComplete(binaryName); }","preventionTips":["Sequence all loads after the resource update-all-complete event.","Never load binaries synchronously at startup before CheckVersion/UpdateResources.","Handle update-failure events so NotReady resources get re-updated.","Queue and replay deferred loads instead of failing fast."],"tags":["gameframework","resource","binary","not-ready","hot-update"],"backgroundTag":"invalid-state-transition","analyzedSha":"d0c010b05167c58e92350449d04864a91ca13fd2","analyzedAt":"2026-09-15T13:37:15.352Z","contentChangedAt":"2026-09-15T13:37:15.352Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}