{"record":{"id":"5304b5975ac928d3","repo":"EllanJiang/GameFramework","slug":"can-not-find-resource-group-0","errorCode":null,"errorMessage":"Can not find resource group '{0}'.","messagePattern":"Can not find resource group '(.+?)'\\.","errorType":"validation","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/Resource/ResourceManager.cs","lineNumber":1322,"sourceCode":"            if (m_ResourceMode == ResourceMode.Unspecified)\n            {\n                throw new GameFrameworkException(\"You must set resource mode first.\");\n            }\n\n            if (m_ResourceMode != ResourceMode.Updatable && m_ResourceMode != ResourceMode.UpdatableWhilePlaying)\n            {\n                throw new GameFrameworkException(\"You can not use UpdateResources without updatable resource mode.\");\n            }\n\n            if (m_ResourceUpdater == null)\n            {\n                throw new GameFrameworkException(\"You can not use UpdateResources at this time.\");\n            }\n\n            ResourceGroup resourceGroup = (ResourceGroup)GetResourceGroup(resourceGroupName);\n            if (resourceGroup == null)\n            {\n                throw new GameFrameworkException(Utility.Text.Format(\"Can not find resource group '{0}'.\", resourceGroupName));\n            }\n\n            m_UpdateResourcesCompleteCallback = updateResourcesCompleteCallback;\n            m_ResourceUpdater.UpdateResources(resourceGroup);\n        }\n\n        /// <summary>\n        /// 停止更新资源。\n        /// </summary>\n        public void StopUpdateResources()\n        {\n            if (m_ResourceMode == ResourceMode.Unspecified)\n            {\n                throw new GameFrameworkException(\"You must set resource mode first.\");\n            }\n\n            if (m_ResourceMode != ResourceMode.Updatable && m_ResourceMode != ResourceMode.UpdatableWhilePlaying)\n            {","sourceCodeStart":1304,"sourceCodeEnd":1340,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Resource/ResourceManager.cs#L1304-L1340","documentation":"This GameFrameworkException (a formatted message) is thrown by ResourceManager.UpdateResources when no resource group matches the supplied resourceGroupName — GetResourceGroup returns null. The named group was never added (AddResourceGroup) or the name is misspelled, so there is nothing to update. It is a lookup-failure guard with the offending group name embedded in the message.","triggerScenarios":"Calling UpdateResources(\"Foo\", cb) when group 'Foo' was never created via AddResourceGroup; typo in the group name; groups added only in some configurations/environments; group added after the UpdateResources call.","commonSituations":"Renaming a resource group in the resource editor but not in code; per-platform group definitions that omit the requested group; calling update before the group list is built at startup.","solutions":["Add the resource group with AddResourceGroup(name) before calling UpdateResources.","Verify the group name matches exactly (case and spelling) with the group defined in your resource configuration.","Log or enumerate existing groups (GetResourceGroup / GetAllResourceGroups) to confirm the expected group exists at call time.","Ensure group creation happens earlier in startup than the update call."],"exampleFix":"// before\nresourceManager.UpdateResources(\"SceneGroup\", callback); // group never added\n// after\nresourceManager.AddResourceGroup(\"SceneGroup\", ...);\nresourceManager.UpdateResources(\"SceneGroup\", callback);","handlingStrategy":"validation","validationCode":"if (resourceManager.GetResourceGroup(groupName) == null)\n{\n    resourceManager.AddResourceGroup(groupName);\n}\nresourceManager.UpdateResources(groupName, callback);","typeGuard":"bool GroupExists(ResourceManager rm, string name) => rm.GetResourceGroup(name) != null;","tryCatchPattern":"try { resourceManager.UpdateResources(groupName, callback); }\ncatch (GameFrameworkException ex) when (ex.Message.StartsWith(\"Can not find resource group\")) { UnityEngine.Debug.LogError($\"Unknown resource group: {ex.Message}\"); }","preventionTips":["Define resource groups at startup before any update calls.","Use constants for group names to avoid typos.","Keep group definitions in sync with the resource editor configuration."],"tags":["csharp","gameframework","resource-group","not-found"],"backgroundTag":"entity-not-found","analyzedSha":"d0c010b05167c58e92350449d04864a91ca13fd2","analyzedAt":"2026-09-15T13:37:15.352Z","contentChangedAt":"2026-09-15T13:37:15.352Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}