EllanJiang/GameFramework · error · GameFrameworkException

You can not use CheckVersionList without updatable resource…

Error message

You can not use CheckVersionList without updatable resource mode.

What it means

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.

Solutions

  1. Switch to ResourceMode.Updatable or UpdatableWhilePlaying if version checking is intended.
  2. Otherwise gate the hot-update flow on the mode and use InitResources for Package builds.
  3. Keep a single bootstrap that branches on the configured resource mode.

Example fix

// before
resourceComponent.SetResourceMode(ResourceMode.Package);
resourceComponent.CheckVersionList(version);
// after
resourceComponent.SetResourceMode(ResourceMode.Updatable);
resourceComponent.CheckVersionList(version);
Defensive patterns

Strategy: validation

Validate before calling

if (m_ResourceComponent.ResourceMode == ResourceMode.Updatable || m_ResourceComponent.ResourceMode == ResourceMode.UpdatableWhilePlaying)
    m_ResourceComponent.CheckVersionList(version);
else
    m_ResourceComponent.InitResources(OnInitResourcesComplete);

Try / catch

try { m_ResourceComponent.CheckVersionList(v); }
catch (GameFrameworkException e) { Log.Fatal("CheckVersionList in non-updatable mode: {0}", e.Message); }

Prevention

When it happens

Trigger: Calling CheckVersionList while m_ResourceMode == ResourceMode.Package.

Common situations: 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.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at GameFramework/Resource/ResourceManager.cs:1129

            m_InitResourcesCompleteCallback = initResourcesCompleteCallback;
            m_ResourceIniter.InitResources(m_CurrentVariant);
        }

        /// <summary>
        /// 使用可更新模式并检查版本资源列表。
        /// </summary>
        /// <param name="latestInternalResourceVersion">最新的内部资源版本号。</param>
        /// <returns>检查版本资源列表结果。</returns>
        public CheckVersionListResult CheckVersionList(int latestInternalResourceVersion)
        {
            if (m_ResourceMode == ResourceMode.Unspecified)
            {
                throw new GameFrameworkException("You must set resource mode first.");
            }

            if (m_ResourceMode != ResourceMode.Updatable && m_ResourceMode != ResourceMode.UpdatableWhilePlaying)
            {
                throw new GameFrameworkException("You can not use CheckVersionList without updatable resource mode.");
            }

            if (m_VersionListProcessor == null)
            {
                throw new GameFrameworkException("You can not use CheckVersionList at this time.");
            }

            return m_VersionListProcessor.CheckVersionList(latestInternalResourceVersion);
        }

        /// <summary>
        /// 使用可更新模式并更新版本资源列表。
        /// </summary>
        /// <param name="versionListLength">版本资源列表大小。</param>
        /// <param name="versionListHashCode">版本资源列表哈希值。</param>
        /// <param name="versionListCompressedLength">版本资源列表压缩后大小。</param>
        /// <param name="versionListCompressedHashCode">版本资源列表压缩后哈希值。</param>
        /// <param name="updateVersionListCallbacks">版本资源列表更新回调函数集。</param>

View on GitHub (pinned to d0c010b051)