Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Resolved]Scene 'X' couldn't be loaded because it has not been added to the build settings

Discussion in 'Addressables' started by gilley033, Mar 26, 2022.

  1. gilley033

    gilley033

    Joined:
    Jul 10, 2012
    Posts:
    1,181
    I am currently experimenting with error handling when it comes to using the Addressable System, i.e., when the program is not able to load an asset (primarily due to download issue), it can load a backup asset that is stored locally on the player's device. To do this I am either intercepting exceptions logged by the Addressable System (ignoring everything but Invalid Key Exceptions), or disabling exception logging on the Addressable Settings asset.

    My system works fine when using prefab addressable assets, however I am experimenting with using Scenes and have run into an issue.

    Right now I am just removing the individual asset bundles in order to force the error system to run. That's probably not the best means of testing the system but I'm not sure what else to do (I am open to ideas).

    The issue with this method is that I am seeing the error message in the title in a built game (it doesn't happen in the editor), which stalls loading. Obviously the exception is thrown because the SceneManager system cannot find the asset bundle scene, but my question is, why isn't this logged via the normal Addressable exception logging system, or else passed along to the AsyncOperationHandle like other download errors.

    Is this issue only applicable to my testing scenario where I am manually deleting the Addressable Asset files? Or will it show up in a normal game when the asset bundle with the scene fails to download for another reason (connection issues for instance).

    Any insight would be greatly appreciated.

    Status: Resolved
    Fixed by upgrading Addressable Package to 1.19.4
     
    Last edited: Apr 6, 2022
  2. gilley033

    gilley033

    Joined:
    Jul 10, 2012
    Posts:
    1,181
    These forums are virtually useless.
     
    mcbauer likes this.
  3. gilley033

    gilley033

    Joined:
    Jul 10, 2012
    Posts:
    1,181
    I have an update:

    I am now making use of the Editor Hosting Service, and have played around with trying to manually trigger download issues. Without download issues, all addressable scenes load fine, but once I introduce errors (by setting the Upload Speed to a low value and setting my group's Request Timeout value to a low value), I see the same error I reported earlier.

    When an addressable scene asset fails to load, unity throws an exception, similar to the following:

    Scene 'Example_3_3' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.


    This definitely has to be a bug. Other loading exceptions can be disabled or else caught and handled by whatever Addressable Loading system we have in place. Unity should catch this scene exception and assign it to the AsyncOperationHandle and set the status of the handle to Failed, like it does with other exceptions.
     
  4. gilley033

    gilley033

    Joined:
    Jul 10, 2012
    Posts:
    1,181