How to check whether or not the requested assetbundle is loaded/cached already

Hey there,

i currently dont know how to prevent the error “The AssetBundle 'pathToAssetBundle/bundle can’t be loaded because another AssetBundle with the same files is already loaded.”.

Im using the following routine everytime i need to access a videoclip out of this bundle:

UnityWebRequest www = UnityWebRequest.GetAssetBundle(bundleURL, 0, 1983471844);

        // wait for load to finish
        yield return www.Send();

        if (www.error != null)
        {
            Debug.LogError("www error: " + www.error);
            www.Dispose();
            www = null;
            yield break;
        }

        // get bundle from downloadhandler
        bundle = ((DownloadHandlerAssetBundle)www.downloadHandler).assetBundle;

“1983471844” is the CRC number out of the bundle.manifest file and i tried to use something like:

if (!Caching.IsVersionCached("bundle", Hash128.Parse("1983471844")))
        {
            Debug.Log("AssetBundle not yet cached");
            StartCoroutine(LoadAssetBundleCoroutine("pathtoAssetBundle/bundle"));
            return;
        }

But that always returns false and doesnt seem to work.
What exactly am i doing wrong or is there another better way of doing so?

when you have equals filename in different ABs for example:
example.com/bundle1 which contains file my.txt
example.com/bundle2 which contains file my.txt
my.txt already exist in bundle1, and you take a error on loading bundle2

also you need ‘using’ around request, example:

using (UnityWebRequest www = UnityWebRequest.GetAssetBundle(bundleURL, 0, 1983471844))
{
        // wait for load to finish
        yield return www.Send();
        if (www.error != null)
        {
            Debug.LogError("www error: " + www.error);
            yield break;
        }
        // get bundle from downloadhandler
        bundle = ((DownloadHandlerAssetBundle)www.downloadHandler).assetBundle;
}

also you don’t need
if (Caching.IsVersionCached
becouse of build-in caching inside UnityWebRequest.GetAssetBundle

also the error may occur if you load same AssetBundle many times, in that case you need to load 1 time, and other times not to reload, but use exist reference to bundle; or bundle.Unload before reload

That doesnt work. Same error.