As the title suggests, I have addressable bundles that load fine in the editor, but when I build, the path provided by the AssetBundleProvider is incorrect. I’ve been beating my head against the wall with this one for a couple of weeks and I’m hoping someone can help. I’ve read similar threads on here, but their solutions were not mine. I’ll try to break this down as clearly and succinctly as possible.
I have two projects. Project A loads an addressable scene and its assets (multiple bundles) from Project B. Project A is a light, UI shell with scripts and Project B contains only the scene and its assets. There is a reason why I need to keep them separate, but the reason is irrelevant to this issue.
The addressable settings in Project B are as follows:
LocalBuildPath = [UnityEngine.Application.persistentDataPath]/addressables (I use the square brackets so the path is determined at build time.)
LocalLoadPath = {UnityEngine.Application.persistentDataPath}/addressables (I use the curly brackets so the path is determined at runtime.)
The group settings:
For “Asset Provider” and “AssetBundle Provider”, there are quite a few options, but not a whole lot of documentation on what each of them does. I’ve tried a number of different combinations.
To build, I go to:
Loading the addressable scene in Project A:
The bundles are downloaded from an S3 bucket to the persistent data path. Due to the nature of our project, I have chosen to download the bundles manually using AWS SDK for .NET instead of having addressables handle the download. When I manually place the files in the persistent data path for Project A and delete the original build files from Project B (so there is only one copy of each bundle on my machine), the addressables load fine in play mode. If I upload the bundles to S3 and delete all of them off my machine, the addressables download and load fine in play mode (so it’s not a download issue.) BUT, when I build the app for iOS, download the bundles and try to load the scene, I’m graced with this error:
Exception encountered in operation Resource(defaultlocalgroup_scenes_all_703a68b13fbcfdcb420946e7f32defc8.bundle): Invalid path in AssetBundleProvider: ‘[persistent data path to Project B]/addressables/defaultlocalgroup_scenes_all_703a68b13fbcfdcb420946e7f32defc8.bundle’.
So, the path it’s trying to load is the persistent data path of Project B instead of the persistent data path for the application which means that the path is hard-written somewhere and is not being determined at runtime. Yet, it loads the correct path in the Editor. Why?
If it’s helpful, here’s my code:
static List<string> loadedCatalogs = new List<string>();
public static void LoadScene(string projectName, MonoBehaviour instance)
{
Addressables.InitializeAsync().Completed += (initOp) =>
{
if (!loadedCatalogs.Contains(projectName))
instance.StartCoroutine(LoadCatalog(projectName, (catalog) =>
{
loadedCatalogs.Add(projectName);
instance.StartCoroutine(LoadSceneAsync(projectName));
}));
else
instance.StartCoroutine(LoadSceneAsync(projectName));
};
}
public static IEnumerator LoadCatalog(string projectName, Action<IList<IResourceLocation>> callback)
{
Debug.Log($"Attempting to load catalog...");
Debug.Log(GetCatalogPath(projectName));
callback(Addressables.LoadResourceLocationsAsync(
Addressables.LoadContentCatalogAsync(GetCatalogPath(projectName))).Result);
yield return null;
}
public static IEnumerator LoadSceneAsync(string projectName)
{
Debug.Log($"Attempting to load scene...");
var async = Addressables.LoadSceneAsync(projectName);
while (!async.IsDone)
{
DialogueHandler.ShowLoadProgress(projectName, (long)(async.PercentComplete * 100));
yield return null;
}
}
I didn’t post the code for GetCatalogPath(string), but it definitely returns the correct file path for the json catalog on all platforms. I’ve also tried this with and without Address.Initialize(). Not sure what that even does anymore as it works in the editor both ways.
I appreciate any and all help! Thanks in advance!


