Issues with loading Addressable scene for second time

My project contains a number of repeatable minigames, each of which have their own scene. All of these scenes are Addressable, and loaded from remote storage.

The issue I’m running into is that I can call Addressables.LoadSceneAsync[ for a given minigame, play it to completion and call Addressables.UnloadSceneAsync[. All of this seems to work well. But when I return to the same minigame, and therefore attempt to reload the same scene (with Addressables.LoadSceneAsync[), I get the following error:

Scene 'ExampleMinigameScene.unity' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.
To add a scene to the build settings use the menu File->Build Settings...
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:<.ctor>b__26_0(AsyncOperationHandle)
DelegateList`1:Invoke(AsyncOperationHandle) (at Library/PackageCache/com.unity.addressables@1.2.4/Runtime/ResourceManager/Util/DelegateList.cs:69)
UnityEngine.ResourceManagement.AsyncOperations.GroupOperation:OnOperationCompleted(AsyncOperationHandle)
DelegateList`1:Invoke(AsyncOperationHandle) (at Library/PackageCache/com.unity.addressables@1.2.4/Runtime/ResourceManager/Util/DelegateList.cs:69)
UnityEngine.ResourceManagement.ResourceProviders.ProvideHandle:Complete(IAssetBundleResource, Boolean, Exception)

This would seem to suggest that LoadSceneAsync will only work once for a given scene before the app needs to be restarted. Can anyone confirm similar issues or potential resolutions?

Note: I get the same results in “Packed Play” mode in the editor, or on a device. It also doesn’t scene to matter if I load the scene as single or additive.

Hey @DanMcElroyHuuuge that is strange. You may be hitting a race condition once your bundles are cached in regards to your scene load. What platform are you seeing this on?

Hey David, thanks for the reply. I’m seeing this on Android, and in the editor (Windows). Have not tried any other platforms so far. A race condition is possible, but even if I wait for over a minute between scene unload and reload I encounter the same issues (these bundles are max. 8MB).

hmm… ok nothing about that really sticks out to me. If you don’t mind filing a bug with Unity and then posting the case number here so I can look it up more easily I’d appreciate it. If you have a small-ish project you can attach to the bug report that would be a huge help.

I don’t know if this will solve your problem, but for me I am using interfaces and what I was encountering when trying to load the addressable a second time was that the reference to an interface was not set to null when the scene was unloaded. So now I am setting the interface reference to null before the scene is destroyed and released, which now I can load the scene a second, third, etc. time.