EllanJiang/GameFramework · error · GameFrameworkException
You can not use UpdateResources without updatable resource…
Error message
You can not use UpdateResources without updatable resource mode.
What it means
This GameFrameworkException is thrown by ResourceManager.UpdateResources when the current ResourceMode is not Updatable or UpdatableWhilePlaying (e.g. Package mode). Updating resource groups over the network only works in updatable modes, so the call is rejected otherwise. It is a mode-compatibility guard.
Solutions
- Use ResourceMode.Updatable or ResourceMode.UpdatableWhilePlaying when network resource updates are required.
- Check ResourceManager.ResourceMode before calling UpdateResources and skip/handle non-updatable modes.
- Remove update calls from Package-mode build paths (e.g. via conditional compilation or config).
Example fix
// before
resourceManager.UpdateResources("MyGroup", callback);
// after
if (resourceManager.ResourceMode == ResourceMode.Updatable || resourceManager.ResourceMode == ResourceMode.UpdatableWhilePlaying)
{
resourceManager.UpdateResources("MyGroup", callback);
} Defensive patterns
Strategy: validation
Validate before calling
var mode = resourceManager.ResourceMode; if (mode != ResourceMode.Updatable && mode != ResourceMode.UpdatableWhilePlaying) return;
Type guard
bool IsUpdatableMode(ResourceMode m) => m == ResourceMode.Updatable || m == ResourceMode.UpdatableWhilePlaying;
Try / catch
try { resourceManager.UpdateResources(groupName, callback); }
catch (GameFrameworkException ex) when (ex.Message.Contains("updatable resource mode")) { UnityEngine.Debug.LogWarning("UpdateResources requires an updatable resource mode."); } Prevention
- Only ship update flow in updatable-mode builds.
- Check ResourceMode before invoking update APIs.
- Keep mode selection and update code paths aligned via config.
When it happens
Trigger: Calling UpdateResources in ResourceMode.Package builds; configurations where hot-update was disabled but update code still executes; shared update code invoked regardless of mode.
Common situations: Publishing a non-updatable build that still runs the update screen; mode selected from config/environment that differs from the code path; testers switching modes without guarding call sites.
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
- You can not use ApplyResources without updatable resource…
- You can not use VerifyResources without updatable resource…
- You can not use CheckResources without updatable resource…
- You can not use VerifyResourcePack without updatable…
- Owner is invalid.
AI-assisted analysis of EllanJiang/GameFramework@d0c010b051 (2026-09-15).
Data as JSON: /api/errors/e6f9ce88e1e201b8.
Report an issue: GitHub.
Appendix: source
Thrown at GameFramework/Resource/ResourceManager.cs:1311
/// 使用可更新模式并更新指定资源组的资源。
/// </summary>
/// <param name="resourceGroupName">要更新的资源组名称。</param>
/// <param name="updateResourcesCompleteCallback">使用可更新模式并更新指定资源组完成时的回调函数。</param>
public void UpdateResources(string resourceGroupName, UpdateResourcesCompleteCallback updateResourcesCompleteCallback)
{
if (updateResourcesCompleteCallback == null)
{
throw new GameFrameworkException("Update resources complete callback is invalid.");
}
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 UpdateResources without updatable resource mode.");
}
if (m_ResourceUpdater == null)
{
throw new GameFrameworkException("You can not use UpdateResources at this time.");
}
ResourceGroup resourceGroup = (ResourceGroup)GetResourceGroup(resourceGroupName);
if (resourceGroup == null)
{
throw new GameFrameworkException(Utility.Text.Format("Can not find resource group '{0}'.", resourceGroupName));
}
m_UpdateResourcesCompleteCallback = updateResourcesCompleteCallback;
m_ResourceUpdater.UpdateResources(resourceGroup);
}
/// <summary>View on GitHub (pinned to d0c010b051)