EllanJiang/GameFramework · error · GameFrameworkException

You can not use VerifyResourcePack without updatable…

Error message

You can not use VerifyResourcePack without updatable resource mode.

What it means

VerifyResourcePack is only supported in updatable resource modes. When m_ResourceMode is Package (or Unspecified, caught earlier), ResourceManager throws this GameFrameworkException because resource packs only exist in the updatable download pipeline. Package-mode games embed all resources and have nothing to verify.

Solutions

  1. Set ResourceMode.Updatable or ResourceMode.UpdatableWhilePlaying when pack verification is needed.
  2. Guard the VerifyResourcePack call with a check that the mode is updatable.
  3. Remove or disable pack-verification code in package-mode builds via conditional compilation or config.

Example fix

// before
resourceManager.VerifyResourcePack(packPath); // Package mode
// after
if (resourceManager.ResourceMode == ResourceMode.Updatable || resourceManager.ResourceMode == ResourceMode.UpdatableWhilePlaying)
{
    resourceManager.VerifyResourcePack(packPath);
}
Defensive patterns

Strategy: validation

Validate before calling

bool ok = rm.ResourceMode == ResourceMode.Updatable || rm.ResourceMode == ResourceMode.UpdatableWhilePlaying;
if (!ok) return;

Type guard

static bool IsUpdatableMode(ResourceMode mode) => mode == ResourceMode.Updatable || mode == ResourceMode.UpdatableWhilePlaying;

Try / catch

try { rm.VerifyResourcePack(p); } catch (GameFrameworkException ex) { Log.Warn("Verify skipped: " + ex.Message); }

Prevention

When it happens

Trigger: Calling VerifyResourcePack while ResourceMode is ResourceMode.Package; switching a build back to package mode but leaving a verify-pack routine in the startup path.

Common situations: Reusing update/verify code between a Package-mode demo build and an Updatable production build; a feature flag toggles mode but the verify call remains unconditional.

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/e7ef4b0715d5f204. Report an issue: GitHub.

Appendix: source

Thrown at GameFramework/Resource/ResourceManager.cs:1377

        {
            if (string.IsNullOrEmpty(resourcePackPath))
            {
                throw new GameFrameworkException("Resource pack path is invalid.");
            }

            if (!File.Exists(resourcePackPath))
            {
                throw new GameFrameworkException(Utility.Text.Format("Resource pack '{0}' is not exist.", resourcePackPath));
            }

            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 VerifyResourcePack without updatable resource mode.");
            }

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

            try
            {
                long length = 0L;
                ResourcePackVersionList versionList = default(ResourcePackVersionList);
                using (FileStream fileStream = new FileStream(resourcePackPath, FileMode.Open, FileAccess.Read))
                {
                    length = fileStream.Length;
                    versionList = m_ResourcePackVersionListSerializer.Deserialize(fileStream);
                }

                if (!versionList.IsValid)

View on GitHub (pinned to d0c010b051)