Quick answer: Load the AssetBundleManifest first, query GetAllDependencies(bundleName), load each dependency bundle, then load the target. Or migrate to Addressables which handles this automatically.
Here is how to fix Unity AssetBundle loads that error with missing dependency references. Bundles split assets across files; you must load the dependency graph yourself.
The Symptom
You build bundles. At runtime, LoadFromFile + LoadAsset returns null or shows missing material/texture errors.
What Causes This
Dependencies not loaded. A prefab in bundle A may reference a texture in bundle B. Loading A alone leaves the texture missing.
No manifest read. The manifest bundle (one per build) describes the dependency graph; without reading it, you cannot resolve.
The Fix
Step 1: Load manifest first.
using UnityEngine;
public class BundleLoader : MonoBehaviour
{
private AssetBundleManifest manifest;
public void Init(string manifestPath)
{
var manifestBundle = AssetBundle.LoadFromFile(manifestPath);
manifest = manifestBundle.LoadAsset<AssetBundleManifest>("AssetBundleManifest");
}
public AssetBundle LoadWithDeps(string bundleName, string bundleRoot)
{
foreach (var dep in manifest.GetAllDependencies(bundleName))
{
AssetBundle.LoadFromFile(System.IO.Path.Combine(bundleRoot, dep));
}
return AssetBundle.LoadFromFile(System.IO.Path.Combine(bundleRoot, bundleName));
}
}
Step 2: Cache loaded bundles. AssetBundle.LoadFromFile on already-loaded path errors. Track loaded bundle objects and skip if present.
Step 3: Reference count for unload. When unloading, check no other consumer needs the bundle. Decrement refs; unload when zero.
Step 4: Or use Addressables. Migrate via the Addressables “Convert from Bundles” tool. The Addressables system handles all of this internally.
Step 5: Verify with manifest dump.
foreach (var b in manifest.GetAllAssetBundles())
{
Debug.Log($"{b}: depends on {string.Join(', ', manifest.GetAllDependencies(b))}");
}
Catches misconfigured dependencies before runtime.
“Load manifest. Load deps. Load target. Or use Addressables for sanity.”
Related Issues
For shader stripping in bundles, see Shader Stripping. For bundle name updates, see Bundle Name.
Manifest. Deps in order. Cache and ref-count. Addressables for cleaner code.