EllanJiang/GameFramework · error · GameFrameworkException

There is already a resource group

Error message

There is already a resource group '{0}' being updated.

What it means

ApplyResources throws this (with the group name interpolated) when a resource group update is currently in progress (m_UpdatingResourceGroup non-null). Applying a resource pack while a group is being updated from remote sources would conflict, so the manager rejects it.

Solutions

  1. Cancel or wait for the running resource group update (completion/failure callback) before calling ApplyResources
  2. Sequence your flow: finish UpdateGroup first, then apply resource packs, or vice versa
  3. Track update state in your game code and refuse pack application while an update is active

Example fix

// before
resourceManager.UpdateGroup("ui", null);
resourceManager.ApplyResources(packPath); // group update still running
// after
void OnGroupUpdateComplete(...) { resourceManager.ApplyResources(packPath); }
resourceManager.UpdateGroup("ui", OnGroupUpdateComplete);
Defensive patterns

Strategy: try-catch

Validate before calling

// track group update state yourself
if (m_GroupUpdating) return; // wait for completion first

Try / catch

try { resourceManager.ApplyResources(packPath); } catch (GameFrameworkException ex) { Log.Warn("Resource group update in progress: " + ex.Message); }

Prevention

When it happens

Trigger: Calling ApplyResources while UpdateGroup/UpdateResources is actively downloading a resource group; initiating a pack application from the same flow that also triggers group updates.

Common situations: Automatic update logic that kicks off both a version-update download and a local resource-pack apply; user pressing 'update' and 'apply pack' near-simultaneously; retry timers colliding with an ongoing update.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


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

Appendix: source

Thrown at GameFramework/Resource/ResourceManager.ResourceUpdater.cs:330

            /// <summary>
            /// 应用指定资源包的资源。
            /// </summary>
            /// <param name="resourcePackPath">要应用的资源包路径。</param>
            public void ApplyResources(string resourcePackPath)
            {
                if (!m_CheckResourcesComplete)
                {
                    throw new GameFrameworkException("You must check resources complete first.");
                }

                if (m_ApplyingResourcePackStream != null)
                {
                    throw new GameFrameworkException(Utility.Text.Format("There is already a resource pack '{0}' being applied.", m_ApplyingResourcePackPath));
                }

                if (m_UpdatingResourceGroup != null)
                {
                    throw new GameFrameworkException(Utility.Text.Format("There is already a resource group '{0}' being updated.", m_UpdatingResourceGroup.Name));
                }

                if (m_UpdateWaitingInfoWhilePlaying.Count > 0)
                {
                    throw new GameFrameworkException("There are already some resources being updated while playing.");
                }

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

                    if (!versionList.IsValid)

View on GitHub (pinned to d0c010b051)