We upgraded from 2019.3 LTS to 2020.3 LTS and addressables has been extremely slow on android. It takes 1-2 minutes to load in our levels while on 2019 it was under 1s even on low end devices.
When profiling, it looks like it is not doing much of anything during the āloadingā time. 95%+ waiting around.
Tried to do some debugging and narrowed it down to this call taking the most time (takes a few mins)
The assetList contains 12 prefabs
foreach (var assetRef in assetList)
{
if (_instances.ContainsKey(assetRef)) continue;
var op = Addressables.LoadAssetAsync<GameObject>(assetRef);
op.Completed += handle =>
{
_instances.Add(assetRef, handle.Result.GetComponent<EntityComponent>());
Interlocked.Increment(ref _assetsLoadedCount);
};
}
Basically loops through a list of AssetReference and loads them async. When all of them are loaded, then the Addressables.InstantiateAsync is called to load the level prefab (this is quick in comparison) 50ms.
Are there some bugs or something I am doing wrong?
The code we used to load the AssetReferences work as expected in 2019.3 LTS (Addresables 1.8.5) but really slow in 2020.3 LTS
Versions 1.15.1 and after will load, but takes a few minutes for AsyncLoad
1.14.2 will crash, giving the exception found here . Unable to cast object of type āSceneProviderā to type āIResourceProviderā. It seems this was fixed in 1.15+
I ran into a similar issue upgrading to Unity 2021.3, where the asset loading thread would just stall for an extra few seconds and do nothing but addressables would not mark the operation as completed. I fixed it by adding the line Application.backgroundLoadingPriority = ThreadPriority.High;
in my code before asset start loading.
Not sure if this was a change caused by engine upgrade or addressables upgrade, or if adding this code is just hiding the underlying problem.
@lhicks Interesting are you using a newer Addressables version? Thereās a new engine change in Unity 2021.2+ for downloading bundles. If the issue persists on the latest Addressables (1.20.5), is it possible to submit a bug ticket with a reproduction?