EllanJiang/GameFramework · error · GameFrameworkException

Can not load scene asset

Error message

Can not load scene asset '{0}' which is a binary asset.

What it means

Thrown by ResourceLoader.LoadScene when the resolved resource for the scene asset is flagged IsLoadFromBinary. Scene assets cannot be loaded from binary (packed raw) resources because scene loading requires the normal resource pipeline; the scene must be packaged as a loadable asset resource instead.

Solutions

  1. Fix the build configuration so scenes are packaged as scene assets, not binary.
  2. Ensure the scene name maps to the correct resource entry.
  3. Provide a failure callback to handle LoadResourceStatus.TypeError gracefully.

Example fix

// before
resourceComponent.LoadScene(sceneName, priority, null);
// after
resourceComponent.LoadScene(sceneName, priority, new LoadSceneCallbacks(onLoaded,
    (n, s, m, u) => Log.Error($"Scene type error: {n} {m}")));
Defensive patterns

Strategy: validation

Validate before calling

// Scenes must not be binary; verify via catalog before load
if (IsBinaryResource(sceneName)) { Log.Error("Scene packed as binary: " + sceneName); return; }

Try / catch

try { resourceComponent.LoadScene(sceneName, priority, callbacksWithTypeError); }
catch (GameFrameworkException ex) { Log.Error(ex.Message); }

Prevention

When it happens

Trigger: Calling LoadScene on a scene whose resourceInfo.IsLoadFromBinary is true while LoadSceneFailureCallback is null.

Common situations: Misconfigured resource build rules that packed a scene as a binary resource, or passing a wrong name that resolves to a binary resource.

Understand the failure class

Background: "is not a compatible type" / "cannot merge" errors: when a value's type doesn't match what the library requires — this error's family across 65 libraries.

Related errors


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

Appendix: source

Thrown at GameFramework/Resource/ResourceManager.ResourceLoader.cs:398

                    if (loadSceneCallbacks.LoadSceneFailureCallback != null)
                    {
                        loadSceneCallbacks.LoadSceneFailureCallback(sceneAssetName, resourceInfo != null && !resourceInfo.Ready ? LoadResourceStatus.NotReady : LoadResourceStatus.NotExist, errorMessage, userData);
                        return;
                    }

                    throw new GameFrameworkException(errorMessage);
                }

                if (resourceInfo.IsLoadFromBinary)
                {
                    string errorMessage = Utility.Text.Format("Can not load scene asset '{0}' which is a binary asset.", sceneAssetName);
                    if (loadSceneCallbacks.LoadSceneFailureCallback != null)
                    {
                        loadSceneCallbacks.LoadSceneFailureCallback(sceneAssetName, LoadResourceStatus.TypeError, errorMessage, userData);
                        return;
                    }

                    throw new GameFrameworkException(errorMessage);
                }

                LoadSceneTask mainTask = LoadSceneTask.Create(sceneAssetName, priority, resourceInfo, dependencyAssetNames, loadSceneCallbacks, userData);
                foreach (string dependencyAssetName in dependencyAssetNames)
                {
                    if (!LoadDependencyAsset(dependencyAssetName, priority, mainTask, userData))
                    {
                        string errorMessage = Utility.Text.Format("Can not load dependency asset '{0}' when load scene '{1}'.", dependencyAssetName, sceneAssetName);
                        if (loadSceneCallbacks.LoadSceneFailureCallback != null)
                        {
                            loadSceneCallbacks.LoadSceneFailureCallback(sceneAssetName, LoadResourceStatus.DependencyError, errorMessage, userData);
                            return;
                        }

                        throw new GameFrameworkException(errorMessage);
                    }
                }

View on GitHub (pinned to d0c010b051)