Ignore msg, we found a soln, thnx Just playing around with the Addressables for the first time. We're trying to release our addressable via Addressables.Release We're on the latest 1.2.3 addressables Here is how we load.. var obj = Addressables.LoadAssetsAsync<T>(assetId, (result) => { // Release the asset here or later somewhere, key is to store off the result.. Addressables.Release(result); }); We're seeing this in the console output "Addressables.Release was called on an object that Addressables was not previously aware of. Thus nothing is being released" Is this expected? The callback method for us is the most simple, we don't want to use Coroutines, the async/await stuff is tricky and seems not fully ready yet? The callback handler is ok but then you have the issue of passing through extra data somehow into the CompletedCalls, just lots of extra stuff that shouldn't be needed. So we wanted to use lambda, but this is only on the LoadAssetsAsync not LoadAssetAsync Either way, if i pass in the the 'return' value ( the AsyncOpHandle - obj ) into the Release function - i don't see the error But the docs say i can pass in the TObject...so we are following the correct procedure as far as we can see.......is there something we're not understanding here? * Nevermind, we switched back to async/await, missed a few things that simplified things considerably many thanks
In the case of LoadAssetsAsync() you actually have to Release() the var obj instead of the result. So you have to store a reference to that obj for as long as the asset should live until you’re ready to unload it. You’re right, I think, that things become a lot simpler when you use coroutines because the callbacks have no way to pass important data without creating closures.
I'm getting this same error OP, and I can't figure it out to save my life. I'm using something similar... I've been reading GameDev Guru's Addressables tutorial. This is for OnEnable, loading the objects... Code (CSharp): void OnEnable() { if (manageMeshModel) { meshReference.LoadAssetAsync<Mesh>().Completed += handle => meshFilter.sharedMesh = handle.Result; } if (manageMeshMaterials) { _materialHandle = Addressables.LoadAssetsAsync<Material>(_materialRuntimeKeys, null, Addressables.MergeMode.Union); _materialHandle.Completed += handle => { handle.Result.CopyTo(_savedMaterials, 0); meshRenderer.sharedMaterials = _savedMaterials; }; } } Then obviously this is to unload it. It's super odd. Code (CSharp): void OnDisable() { if (manageMeshModel) { var model = meshFilter.sharedMesh; meshFilter.sharedMesh = null; Addressables.Release(model); } if (manageMeshMaterials) { Addressables.Release(_materialHandle); } } Same error that the addressables were previously unaware of a mesh, the material doesn't through an error but on disabled objects I have checked and the material is still on it. Addressables need more documentation! Unless I missed something official, this is all super new to me.
Necroing this thread because it frequently shows up at google searches. If you're receiving those warnings make sure that you are releasing the Handles themselves through Addressables.Release(put handle here), not the results. Also worth noticing that if you are using Addressables.InstantiateAsync(), if you want to destroy the created GameObject and release it's depedencies, use Addressables.ReleaseInstance(put handle here). Addressables.ReleaseInstance() will destroy the GameObject for you (you don't need to manually call Destroy(GameObject).
Will the asset be removed from memory even if the asset bundle's other assets are still active ? How do we unload the entire asset bundle ?
!! Solved !! I had the same error and I solved it. Imagine my asset Reference name was a_Ref and said a_Ref.LoadAssetAsync<T>(). Then when I wanted to release it I was saying Addressables.Release(a_Ref) and that was why I was seeing the error. But now I say a_Ref.ReleaseAsset() and no errors and its working like a charm. And dont forget always to check if the asset is Valid before you try to release it Like this : if (a_Ref.IsValid()) a_Ref.ReleaseAsset(); Hope this helps others.
You would have to release every single handle you requested that belongs to the specific bundle (and destroy gameobjects with ReleaseInstance if you have any). Addressables will not unload the bundle from memory until it's certain that you're not using it anymore.
Can you please explain what you mean by handle? I am facing this error trying to release an assetReferenceGameObject. any ideas?