{"record":{"id":"3dca4cedc5266050","repo":"EllanJiang/GameFramework","slug":"you-can-not-use-updateversionlist-without-updatable-resource","errorCode":null,"errorMessage":"You can not use UpdateVersionList without updatable resource mode.","messagePattern":"You can not use UpdateVersionList without updatable resource mode\\.","errorType":"exception","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/Resource/ResourceManager.cs","lineNumber":1162,"sourceCode":"        /// <param name=\"versionListHashCode\">版本资源列表哈希值。</param>\n        /// <param name=\"versionListCompressedLength\">版本资源列表压缩后大小。</param>\n        /// <param name=\"versionListCompressedHashCode\">版本资源列表压缩后哈希值。</param>\n        /// <param name=\"updateVersionListCallbacks\">版本资源列表更新回调函数集。</param>\n        public void UpdateVersionList(int versionListLength, int versionListHashCode, int versionListCompressedLength, int versionListCompressedHashCode, UpdateVersionListCallbacks updateVersionListCallbacks)\n        {\n            if (updateVersionListCallbacks == null)\n            {\n                throw new GameFrameworkException(\"Update version list callbacks is invalid.\");\n            }\n\n            if (m_ResourceMode == ResourceMode.Unspecified)\n            {\n                throw new GameFrameworkException(\"You must set resource mode first.\");\n            }\n\n            if (m_ResourceMode != ResourceMode.Updatable && m_ResourceMode != ResourceMode.UpdatableWhilePlaying)\n            {\n                throw new GameFrameworkException(\"You can not use UpdateVersionList without updatable resource mode.\");\n            }\n\n            if (m_VersionListProcessor == null)\n            {\n                throw new GameFrameworkException(\"You can not use UpdateVersionList at this time.\");\n            }\n\n            m_UpdateVersionListCallbacks = updateVersionListCallbacks;\n            m_VersionListProcessor.UpdateVersionList(versionListLength, versionListHashCode, versionListCompressedLength, versionListCompressedHashCode);\n        }\n\n        /// <summary>\n        /// 使用可更新模式并校验资源。\n        /// </summary>\n        /// <param name=\"verifyResourceLengthPerFrame\">每帧至少校验资源的大小，以字节为单位。</param>\n        /// <param name=\"verifyResourcesCompleteCallback\">使用可更新模式并校验资源完成时的回调函数。</param>\n        public void VerifyResources(int verifyResourceLengthPerFrame, VerifyResourcesCompleteCallback verifyResourcesCompleteCallback)\n        {","sourceCodeStart":1144,"sourceCodeEnd":1180,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Resource/ResourceManager.cs#L1144-L1180","documentation":"Thrown by ResourceManager.UpdateVersionList when the resource mode is concrete but not updatable (ResourceMode.Package). Version-list updating only exists for Updatable and UpdatableWhilePlaying modes.","triggerScenarios":"Calling UpdateVersionList while m_ResourceMode == ResourceMode.Package.","commonSituations":"Package-mode build still executing hot-update code path (shared GameEntry logic), or the mode flipped to Package without disabling the update flow.","solutions":["Use ResourceMode.Updatable or UpdatableWhilePlaying for the version-list flow.","Branch your bootstrap on the resource mode and skip update APIs in Package builds.","Align build configuration with the code path (strip update flow for packaged builds)."],"exampleFix":"// before\nresourceComponent.SetResourceMode(ResourceMode.Package);\nresourceComponent.UpdateVersionList(len, hash, cLen, cHash, callbacks);\n// after\nresourceComponent.SetResourceMode(ResourceMode.Updatable);\nresourceComponent.UpdateVersionList(len, hash, cLen, cHash, callbacks);","handlingStrategy":"validation","validationCode":"if (m_ResourceComponent.ResourceMode == ResourceMode.Updatable || m_ResourceComponent.ResourceMode == ResourceMode.UpdatableWhilePlaying)\n    m_ResourceComponent.UpdateVersionList(len, hash, cLen, cHash, callbacks);","typeGuard":null,"tryCatchPattern":"try { m_ResourceComponent.UpdateVersionList(len, hash, cLen, cHash, callbacks); }\ncatch (GameFrameworkException e) { Log.Fatal(\"UpdateVersionList in non-updatable mode: {0}\", e.Message); }","preventionTips":["Only run the version-list flow in updatable modes.","Use compile-time or bootstrap flags to strip update code from Package builds.","Keep one code path per resource mode."],"tags":["unity","gameframework","resource-manager","resource-mode","wrong-api"],"backgroundTag":"unsupported-operation","analyzedSha":"d0c010b05167c58e92350449d04864a91ca13fd2","analyzedAt":"2026-09-15T13:37:15.352Z","contentChangedAt":"2026-09-15T13:37:15.352Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}