ClearDependencyCacheAsync AssetBundle is still in use

I’m trying to delete the cached asset bundles for a given asset using ClearDependencyCacheAsync.
It works fine if the bundles were never loaded in the session, but if they were, I can’t seem to figure out how to fully unload them to be able to delete them. I get the warning: "AssetBundle “bundle.name” with hash “hash#” is still in use.

For my tests, I just download the dependencies for an asset, but never use it, then use Addressables.Release on the operation handles and the resource locator, is there something else I need to do?

Also, using AssetBundles.GetAllLoadedAssetBundles() returns 0 items.

Thanks.

I have same problem like this.
Is it been solved?
I tried
Resources.UnloadUnusedAssets---->No use.
and not really good method,
find the path and Use System.IO to delete the folder but there had the lock file I cant delete it.
and try LoadAsset again the unity will crash.
--------------------Update
I found some solution but still not work completely.
I call the AssetBundle.UnloadAllAssetBundles(true);
then Clear bundle again.
Okay It works! but I Cant LoadAsset instead…
Unable to load dependent bundle from location
The same problem in here
Unable to load dependent bundle from location

Didn’t fix this until now?:frowning:
Is there has any solution?
Hope that! thank you.

Had this issue today
AssetReference.ReleaseAsset() is the function you need to run before running ClearDependencyCacheAsync()

1 Like