{"record":{"id":"1076db8dd3d4fb16","repo":"EllanJiang/GameFramework","slug":"you-can-not-use-checkversionlist-without-updatable-resource","errorCode":null,"errorMessage":"You can not use CheckVersionList without updatable resource mode.","messagePattern":"You can not use CheckVersionList without updatable resource mode\\.","errorType":"exception","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/Resource/ResourceManager.cs","lineNumber":1129,"sourceCode":"            m_InitResourcesCompleteCallback = initResourcesCompleteCallback;\n            m_ResourceIniter.InitResources(m_CurrentVariant);\n        }\n\n        /// <summary>\n        /// 使用可更新模式并检查版本资源列表。\n        /// </summary>\n        /// <param name=\"latestInternalResourceVersion\">最新的内部资源版本号。</param>\n        /// <returns>检查版本资源列表结果。</returns>\n        public CheckVersionListResult CheckVersionList(int latestInternalResourceVersion)\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 CheckVersionList without updatable resource mode.\");\n            }\n\n            if (m_VersionListProcessor == null)\n            {\n                throw new GameFrameworkException(\"You can not use CheckVersionList at this time.\");\n            }\n\n            return m_VersionListProcessor.CheckVersionList(latestInternalResourceVersion);\n        }\n\n        /// <summary>\n        /// 使用可更新模式并更新版本资源列表。\n        /// </summary>\n        /// <param name=\"versionListLength\">版本资源列表大小。</param>\n        /// <param name=\"versionListHashCode\">版本资源列表哈希值。</param>\n        /// <param name=\"versionListCompressedLength\">版本资源列表压缩后大小。</param>\n        /// <param name=\"versionListCompressedHashCode\">版本资源列表压缩后哈希值。</param>\n        /// <param name=\"updateVersionListCallbacks\">版本资源列表更新回调函数集。</param>","sourceCodeStart":1111,"sourceCodeEnd":1147,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Resource/ResourceManager.cs#L1111-L1147","documentation":"Thrown by ResourceManager.CheckVersionList when the resource mode is a concrete value but not an updatable one (i.e., it is ResourceMode.Package). Version-list checking only exists for Updatable and UpdatableWhilePlaying modes.","triggerScenarios":"Calling CheckVersionList while m_ResourceMode == ResourceMode.Package.","commonSituations":"A project using shipped-package resources accidentally runs the hot-update bootstrap (e.g., shared GameEntry code that always calls CheckVersionList), or the mode was changed to Package for a build without removing update flow calls.","solutions":["Switch to ResourceMode.Updatable or UpdatableWhilePlaying if version checking is intended.","Otherwise gate the hot-update flow on the mode and use InitResources for Package builds.","Keep a single bootstrap that branches on the configured resource mode."],"exampleFix":"// before\nresourceComponent.SetResourceMode(ResourceMode.Package);\nresourceComponent.CheckVersionList(version);\n// after\nresourceComponent.SetResourceMode(ResourceMode.Updatable);\nresourceComponent.CheckVersionList(version);","handlingStrategy":"validation","validationCode":"if (m_ResourceComponent.ResourceMode == ResourceMode.Updatable || m_ResourceComponent.ResourceMode == ResourceMode.UpdatableWhilePlaying)\n    m_ResourceComponent.CheckVersionList(version);\nelse\n    m_ResourceComponent.InitResources(OnInitResourcesComplete);","typeGuard":null,"tryCatchPattern":"try { m_ResourceComponent.CheckVersionList(v); }\ncatch (GameFrameworkException e) { Log.Fatal(\"CheckVersionList in non-updatable mode: {0}\", e.Message); }","preventionTips":["Branch bootstrap on ResourceMode instead of always running the update flow.","Keep Package builds free of version-list calls.","Document which init path each mode requires."],"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-15T23:17:13.987Z"}