EllanJiang/GameFramework · error · GameFrameworkException
Resource load type ' ' is not supported.
Error message
Resource load type '{0}' is not supported. What it means
Resources carry a LoadType (LoadFromBinary / LoadFromFile / LoadFromMemory, depending on build settings per resource). Start dispatches to the matching helper API (ReadFile/ReadBytes/etc.); if the enum value is unrecognized it throws this formatted error including the type value.
Solutions
- Rebuild the resource package with the same GameFramework ResourceEditor version used at runtime so LoadType values match.
- Ensure every enum value your build can emit has a corresponding branch in LoadResourceAgent.Start.
- Regenerate resource metadata (resource collection) if it was hand-edited or corrupted.
- Update GameFramework runtime and editor packages together to keep LoadType definitions in sync.
Example fix
// before
else
{
throw new GameFrameworkException(Utility.Text.Format("Resource load type '{0}' is not supported.", resourceInfo.LoadType));
}
// after
case LoadType.LoadFromMemory:
m_Helper.ReadBytes(fullPath); // add handling for the new type
break; Defensive patterns
Strategy: try-catch
Validate before calling
if (resourceInfo.LoadType != LoadType.LoadFromBinary
&& resourceInfo.LoadType != LoadType.LoadFromFile
&& resourceInfo.LoadType != LoadType.LoadFromMemory)
{
Debug.LogError($"Unsupported LoadType {resourceInfo.LoadType} — rebuild resource package with matching GameFramework version.");
} Try / catch
try
{
resourceComponent.LoadAsset(assetName, assetType, callback);
}
catch (GameFrameworkException ex) when (ex.Message.Contains("is not supported"))
{
Debug.LogError("Resource package built with incompatible LoadType; rebuild resources with the same GameFramework ResourceEditor version.");
} Prevention
- Rebuild resource packages with the same GameFramework runtime/editor version.
- Keep LoadType enums in sync between editor build tools and runtime.
- Never hand-edit resource metadata files.
- If adding a custom LoadType, extend LoadResourceAgent.Start with the matching branch.
When it happens
Trigger: A ResourceInfo whose LoadType is not one the loader handles — e.g. corrupt/incomplete resource metadata from the package, resources built by a mismatched GameFramework/ResourceEditor version, or a custom enum value added without extending the Start switch.
Common situations: Resource package built with a different GameFramework ResourceEditor version than the runtime; hand-edited or stale resource collection metadata; custom LoadType extension not reflected in LoadResourceAgent.Start; mixing builds of streaming assets and AssetBundles.
Related errors
- appendErrorMessage
- Can not find dependency resource.
- Decrypt resource callback is invalid.
- Load resource agent helper is invalid.
- Resource helper is invalid.
AI-assisted analysis of EllanJiang/GameFramework@d0c010b051 (2026-09-15).
Data as JSON: /api/errors/e49f7160f9aac84e.
Report an issue: GitHub.
Appendix: source
Thrown at GameFramework/Resource/ResourceManager.ResourceLoader.LoadResourceAgent.cs:236
{
m_Helper.ReadFile(fullPath);
}
}
else if (resourceInfo.LoadType == LoadType.LoadFromMemory || resourceInfo.LoadType == LoadType.LoadFromMemoryAndQuickDecrypt || resourceInfo.LoadType == LoadType.LoadFromMemoryAndDecrypt)
{
if (resourceInfo.UseFileSystem)
{
IFileSystem fileSystem = m_ResourceLoader.m_ResourceManager.GetFileSystem(resourceInfo.FileSystemName, resourceInfo.StorageInReadOnly);
m_Helper.ReadBytes(fileSystem, resourceInfo.ResourceName.FullName);
}
else
{
m_Helper.ReadBytes(fullPath);
}
}
else
{
throw new GameFrameworkException(Utility.Text.Format("Resource load type '{0}' is not supported.", resourceInfo.LoadType));
}
return StartTaskStatus.CanResume;
}
/// <summary>
/// 重置加载资源代理。
/// </summary>
public void Reset()
{
m_Helper.Reset();
m_Task = null;
}
private static bool IsAssetLoading(string assetName)
{
return s_LoadingAssetNames.Contains(assetName);
}View on GitHub (pinned to d0c010b051)