EllanJiang/GameFramework · error · GameFrameworkException

Resource group ' ' is not exist.

Error message

Resource group '{0}' is not exist.

What it means

GetResourceGroupCollection resolves each name via GetResourceGroup; if no resource group with that name exists, the resolved group is null and this formatted GameFrameworkException is thrown naming the missing group. The collection cannot be built from a group that was never added.

Solutions

  1. Use the exact resource group name defined in the resource configuration
  2. Add the missing resource group before building a collection over it (AddResourceGroup)
  3. Log available groups (GetAllResourceGroups) to find the correct name

Example fix

// before
var col = manager.GetResourceGroupCollection("UiRes"); // group is named "UIRes"
// after
if (manager.GetResourceGroup("UiRes") == null)
    manager.AddResourceGroup("UiRes", ...);
var col = manager.GetResourceGroupCollection("UiRes");
Defensive patterns

Strategy: validation

Validate before calling

if (manager.GetResourceGroup(name) == null)
    throw new InvalidOperationException($"Resource group '{name}' does not exist; register it first.");

Type guard

bool GroupExists(ResourceManager m, string name) => m.GetResourceGroup(name) != null;

Try / catch

try { var col = manager.GetResourceGroupCollection(names); }
catch (GameFrameworkException ex) when (ex.Message.Contains("is not exist")) { log.Error(ex.Message); /* prompt for correct group or add it */ }

Prevention

When it happens

Trigger: Calling GetResourceGroupCollection with a name that was never created via AddResourceGroup / loaded resource list — e.g. a typo or a group defined only in a newer resource config version.

Common situations: Resource config updated on the server but the group name hardcoded in client code is stale; case-mismatch between the configured name and the lookup name.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at GameFramework/Resource/ResourceManager.cs:2196

        public IResourceGroupCollection GetResourceGroupCollection(params string[] resourceGroupNames)
        {
            if (resourceGroupNames == null || resourceGroupNames.Length < 1)
            {
                throw new GameFrameworkException("Resource group names is invalid.");
            }

            ResourceGroup[] resourceGroups = new ResourceGroup[resourceGroupNames.Length];
            for (int i = 0; i < resourceGroupNames.Length; i++)
            {
                if (string.IsNullOrEmpty(resourceGroupNames[i]))
                {
                    throw new GameFrameworkException("Resource group name is invalid.");
                }

                resourceGroups[i] = (ResourceGroup)GetResourceGroup(resourceGroupNames[i]);
                if (resourceGroups[i] == null)
                {
                    throw new GameFrameworkException(Utility.Text.Format("Resource group '{0}' is not exist.", resourceGroupNames[i]));
                }
            }

            return new ResourceGroupCollection(resourceGroups, m_ResourceInfos);
        }

        /// <summary>
        /// 获取资源组集合。
        /// </summary>
        /// <param name="resourceGroupNames">要获取的资源组名称的集合。</param>
        /// <returns>要获取的资源组集合。</returns>
        public IResourceGroupCollection GetResourceGroupCollection(List<string> resourceGroupNames)
        {
            if (resourceGroupNames == null || resourceGroupNames.Count < 1)
            {
                throw new GameFrameworkException("Resource group names is invalid.");
            }

View on GitHub (pinned to d0c010b051)