Hi,
I am getting below error on build.
I am using
Unity 2020.3.38f1
Addressables 1.20.5
Releasing render texture that is set as Camera.targetTexture!
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.ResourceManagement.ResourceProviders.AssetBundleResource:Unload () (at C:/Users/fkkcl/Documents/dev/kafka/Library/PackageCache/com.unity.addressables@1.18.19/Runtime/ResourceManager/ResourceProviders/AssetBundleProvider.cs:528)
UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider:Release (UnityEngine.ResourceManagement.ResourceLocations.IResourceLocation,object) (at C:/Users/fkkcl/Documents/dev/kafka/Library/PackageCache/com.unity.addressables@1.18.19/Runtime/ResourceManager/ResourceProviders/AssetBundleProvider.cs:575)
UnityEngine.ResourceManagement.AsyncOperations.ProviderOperation1<UnityEngine.ResourceManagement.ResourceProviders.IAssetBundleResource>:smile:estroy () (at C:/Users/fkkcl/Documents/dev/kafka/Library/PackageCache/com.unity.addressables@1.18.19/Runtime/ResourceManager/AsyncOperations/ProviderOperation.cs:281) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase
1<UnityEngine.ResourceManagement.ResourceProviders.IAssetBundleResource>:smile:ecrementReferenceCount () (at C:/Users/fkkcl/Documents/dev/kafka/Library/PackageCache/com.unity.addressables@1.18.19/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:187)
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1<UnityEngine.ResourceManagement.ResourceProviders.IAssetBundleResource>:UnityEngine.ResourceManagement.AsyncOperations.IAsyncOperation.DecrementReferenceCount () (at C:/Users/fkkcl/Documents/dev/kafka/Library/PackageCache/com.unity.addressables@1.18.19/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:527) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle:Release () (at C:/Users/fkkcl/Documents/dev/kafka/Library/PackageCache/com.unity.addressables@1.18.19/Runtime/ResourceManager/AsyncOperations/AsyncOperationHandle.cs:516) UnityEngine.ResourceManagement.AsyncOperations.GroupOperation:ReleaseDependencies () (at C:/Users/fkkcl/Documents/dev/kafka/Library/PackageCache/com.unity.addressables@1.18.19/Runtime/ResourceManager/AsyncOperations/GroupOperation.cs:70) UnityEngine.ResourceManagement.AsyncOperations.GroupOperation:smile:estroy () (at C:/Users/fkkcl/Documents/dev/kafka/Library/PackageCache/com.unity.addressables@1.18.19/Runtime/ResourceManager/AsyncOperations/GroupOperation.cs:185) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase
1<System.Collections.Generic.IList1<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle>>:smile:ecrementReferenceCount () (at C:/Users/fkkcl/Documents/dev/kafka/Library/PackageCache/com.unity.addressables@1.18.19/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:187) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle
1<System.Collections.Generic.IList1<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle>>:Release () (at C:/Users/fkkcl/Documents/dev/kafka/Library/PackageCache/com.unity.addressables@1.18.19/Runtime/ResourceManager/AsyncOperations/AsyncOperationHandle.cs:259) UnityEngine.ResourceManagement.ResourceProviders.SceneProvider/SceneOp:smile:estroy () (at C:/Users/fkkcl/Documents/dev/kafka/Library/PackageCache/com.unity.addressables@1.18.19/Runtime/ResourceManager/ResourceProviders/SceneProvider.cs:128) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase
1<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>:smile:ecrementReferenceCount () (at C:/Users/fkkcl/Documents/dev/kafka/Library/PackageCache/com.unity.addressables@1.18.19/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:187)
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle1<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>:Release () (at C:/Users/fkkcl/Documents/dev/kafka/Library/PackageCache/com.unity.addressables@1.18.19/Runtime/ResourceManager/AsyncOperations/AsyncOperationHandle.cs:259) UnityEngine.ResourceManagement.ResourceProviders.SceneProvider/UnloadSceneOp:UnloadSceneCompleted (UnityEngine.AsyncOperation) (at C:/Users/fkkcl/Documents/dev/kafka/Library/PackageCache/com.unity.addressables@1.18.19/Runtime/ResourceManager/ResourceProviders/SceneProvider.cs:205) UnityEngine.ResourceManagement.ResourceProviders.SceneProvider/UnloadSceneOp:Execute () (at C:/Users/fkkcl/Documents/dev/kafka/Library/PackageCache/com.unity.addressables@1.18.19/Runtime/ResourceManager/ResourceProviders/SceneProvider.cs:187) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase
1<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>:InvokeExecute () (at C:/Users/fkkcl/Documents/dev/kafka/Library/PackageCache/com.unity.addressables@1.18.19/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:474)
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>:Start (UnityEngine.ResourceManagement.ResourceManager,UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle,DelegateList
1) (at C:/Users/fkkcl/Documents/dev/kafka/Library/PackageCache/com.unity.addressables@1.18.19/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:469)
UnityEngine.ResourceManagement.ResourceManager:StartOperation<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance> (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>,UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle) (at C:/Users/fkkcl/Documents/dev/kafka/Library/PackageCache/com.unity.addressables@1.18.19/Runtime/ResourceManager/ResourceManager.cs:460) UnityEngine.ResourceManagement.ResourceProviders.SceneProvider:ReleaseScene (UnityEngine.ResourceManagement.ResourceManager,UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle
1<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>) (at C:/Users/fkkcl/Documents/dev/kafka/Library/PackageCache/com.unity.addressables@1.18.19/Runtime/ResourceManager/ResourceProviders/SceneProvider.cs:242)
UnityEngine.ResourceManagement.ResourceManager:ReleaseScene (UnityEngine.ResourceManagement.ResourceProviders.ISceneProvider,UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance>) (at C:/Users/fkkcl/Documents/dev/kafka/Library/PackageCache/com.unity.addressables@1.18.19/Runtime/ResourceManager/ResourceManager.cs:976)
UnityEngine.AddressableAssets.AddressablesImpl:OnSceneUnloaded (UnityEngine.SceneManagement.Scene) (at C:/Users/fkkcl/Documents/dev/kafka/Library/PackageCache/com.unity.addressables@1.18.19/Runtime/AddressablesImpl.cs:189)
UnityEngine.SceneManagement.SceneManager:Internal_SceneUnloaded (UnityEngine.SceneManagement.Scene)
I tried to put release manually just in case on Unload but its not working.
RenderTexture.active = null;
Camera[] comp = FindObjectsOfType<Camera>(true);
Debug.Log("camera count:" + comp.Length);
foreach (var c in comp)
{
if (!c) continue;
Debug.Log($"Found camera '{c.name}' - resetting targetTexture");
if (c.targetTexture) c.targetTexture.Release();
c.targetTexture = null;
c.gameObject.SetActive(false);
}
Hi!
Have you managed to fix this? We are having a similar issue with URPs internal RenderTextures not being unloaded. Also using Addressables.
Unity 2022.1.20f1
we had the same issue in one of our projects, not sue but there was a related bug reported, you can check it out and vote it to speed it up at