AssetBundle.LoadAssetAsync case freezing in Unity5.5.0p1

When called AssetBundle.LoadAssetAsync many times in the same time will case editor freezing. (android is the same problem)

Like this:

AssetBundle ab = xxx;

AssetBundleRequest req1 = ab.LoadAssetAsync(“a1”, typeof(GameObject))

AssetBundleRequest req2 = ab.LoadAssetAsync(“a2”, typeof(GameObject))

AssetBundleRequest req3 = ab.LoadAssetAsync(“a3”, typeof(GameObject))

Called many times in the same time, and then case freezing.

If called from coroutine one by one will ok.

Is anyone has this problem?

My project is upgrade from unity5.4.3 to unity5.5.0f1(or 5.5.0p1)

I met the same problem, both freeze on android and editor. I queue the load action to resolve this problem.
But I think it should be a bug, have find a better way to deal with it?

Firstly, the AssetBundle.LoadAssetAsync function is only available in Unity Pro. Are you using Unity Pro?

Secondly, have you tried the non-asynchronous AssetBundle.Load function?

I met the same problem too 5.5.0p2. you should use LoadAsset

I have freeze on this lines:

yield return SceneManager.LoadSceneAsync(sceneName);
assetBundle.Unload (false);

if I comment unload line everything seems ok for me (apart from memory leaks). Issue reproduces if asset bundles didn’t cache yet and also appears in older versions of unity. Please keep me in touch if you will found a solution

hello guys( @anton-melegov , @Szzwp , @watsonsong ), we encountered something similar, and for us it worked the fallowing workaround:

AssetBundleCreateRequest request = AssetBundle.LoadFromFileAsync(Application.streamingAssetsPath + assetBundle);
yield return request; // wait for the asset bundle to load;
AssetBundle tempAB = request.assetBundle;
AssetBundleRequest abr = temp.LoadAllAssetsAsync();
yield return abr; // wait for all assets to be loaded in ram and video ram
myassetBundle = tempAB;

// now you can load any resources you want
myassetBundle.LoadAssetAsync(path);

the trick is to wait for all the resources to be loaded (async so no major freeze will be encountered)
and all the loadassetAsync will return most probably with the asset already loaded, so it will be done before the next loadassetasync will be called. We didn’t had a lot of time to test exactly what it’s happening, but we haven’t encountered any other freeze after we implemented this.
I hope it helps someone :slight_smile: