EllanJiang/GameFramework · error · GameFrameworkException

Can not find dependency resource.

Error message

Can not find dependency resource.

What it means

After an asset's underlying resource loads, the agent resolves each dependency asset via m_AssetToResourceMap to attach dependency ResourceObjects. If a dependency asset name has no mapped resource, the dependency graph is inconsistent and it throws, aborting the load.

Solutions

  1. Rebuild the resource package so dependency metadata includes all required assets.
  2. Check ResourceEditor settings/analysis rules so needed dependency assets are not excluded from the build.
  3. Ensure the build-in / resource-version files shipped with the app match the AssetBundle content.
  4. Verify the asset's dependency list is complete by re-analyzing it in the ResourceEditor.

Example fix

// before
// package built with dependency asset missing
BuildAssetBundleOptions opts = BuildAssetBundleOptions.None;
// after
// rebuild resource package with ResourceEditor so all dependencies are collected
resourceEditor.BuildResources(); // ensures m_AssetToResourceMap covers every dependencyAsset
Defensive patterns

Strategy: validation

Validate before calling

if (!resourceComponent.HasAsset(dependencyAssetName))
{
    Debug.LogError($"Dependency '{dependencyAssetName}' missing from resource package; rebuild resources.");
}

Try / catch

try
{
    resourceComponent.LoadAsset(assetName, assetType, callback);
}
catch (GameFrameworkException ex) when (ex.Message == "Can not find dependency resource.")
{
    Debug.LogError("Resource package metadata is missing a dependency; rebuild the resource package in ResourceEditor.");
}

Prevention

When it happens

Trigger: AssetObjectToResourceObject loop encounters a dependencyAsset absent from the asset-to-resource map — e.g. resource package metadata missing entries, dependency asset not included in the build, or loading an asset whose dependencies were stripped.

Common situations: Resource collection in ResourceEditor not rebuilt after adding dependencies; resources removed by 'remove unused' rules that were actually needed; loading assets from an older resource package against newer metadata; custom helper returning incomplete dependency lists.

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/7279de2ba718f5d1. Report an issue: GitHub.

Appendix: source

Thrown at GameFramework/Resource/ResourceManager.ResourceLoader.LoadResourceAgent.cs:345

                        assetObject = m_ResourceLoader.m_AssetPool.Spawn(m_Task.AssetName);
                    }

                    if (assetObject == null)
                    {
                        List<object> dependencyAssets = m_Task.GetDependencyAssets();
                        assetObject = AssetObject.Create(m_Task.AssetName, e.Asset, dependencyAssets, m_Task.ResourceObject.Target, m_ResourceHelper, m_ResourceLoader);
                        m_ResourceLoader.m_AssetPool.Register(assetObject, true);
                        m_ResourceLoader.m_AssetToResourceMap.Add(e.Asset, m_Task.ResourceObject.Target);
                        foreach (object dependencyAsset in dependencyAssets)
                        {
                            object dependencyResource = null;
                            if (m_ResourceLoader.m_AssetToResourceMap.TryGetValue(dependencyAsset, out dependencyResource))
                            {
                                m_Task.ResourceObject.AddDependencyResource(dependencyResource);
                            }
                            else
                            {
                                throw new GameFrameworkException("Can not find dependency resource.");
                            }
                        }
                    }

                    s_LoadingAssetNames.Remove(m_Task.AssetName);
                    OnAssetObjectReady(assetObject);
                }

                private void OnLoadResourceAgentHelperError(object sender, LoadResourceAgentHelperErrorEventArgs e)
                {
                    OnError(e.Status, e.ErrorMessage);
                }
            }
        }
    }
}

View on GitHub (pinned to d0c010b051)