Search Unity

[0.7.4] Addressables.LoadScene failing to load scene in standalone builds

Discussion in 'Addressables' started by dnnkeeper, Apr 24, 2019.

  1. dnnkeeper

    dnnkeeper

    Joined:
    Jul 7, 2013
    Posts:
    84
    I'm trying to load a remote scene asset using Addressables.LoadScene("NewScene"); but it fails to load with error:
    Code (CSharp):
    1. 'Scene 'Assets/Scenes/NewScene.unity' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.'
    I assume I'm not supposed to add downloadable scenes to the build settings.
    It works fine in Editor with Packed Mode but when I launch windows standalone build or android build it fails to load scene after downloading.
    I uploaded my project with example scripts to github so you can test it: https://github.com/dnnkeeper/UnityAddressablesTest
    I used Miniweb to quickly launch local web server for testing purposes.
     
  2. sophiepeithos

    sophiepeithos

    Joined:
    Sep 10, 2014
    Posts:
    59
    same problem here
     
  3. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    Thanks for letting us know, and for the repro. We'll look into this asap
     
    dnnkeeper likes this.
  4. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    This should be fixed in 0.7.5-preview. Let us know if it isn't.
     
    dnnkeeper likes this.
  5. Rafarel

    Rafarel

    Joined:
    Jul 21, 2017
    Posts:
    199
    I have the same error in 0.7.5 and in editor packed mode ...


    Scene 'Assets/Scenes/Main.unity' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.


    Here is my addressables group for scenes :

    Addressables-scene-group.PNG

    And I'm trying to load the scene like this :


    Addressables.LoadScene("scene-main", LoadSceneMode.Additive);


    All is working fine in Fast mode but not in packed mode.
     
  6. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    Hmm, that's really odd. I'm guessing/hoping it's due to some bad cache data. Please try these steps:
    1. update to addressables 0.8.4 (shouldn't be needed, but why not)
    2. in addressables window, do
      1. Build->Clean->All
      2. Build->Build Player Contnet
    3. then enter play mode in Packed play mode.
    That'll clear out our build cache and ensure there's no bad data left around from an earlier version of addressables.
     
  7. Rafarel

    Rafarel

    Joined:
    Jul 21, 2017
    Posts:
    199
    I always clean the build cache when I'm in trouble or update addressables version.
    For now, I removed Addressable package to move back to asset bundles because this prevents me to build my game and it was a serious issue for my collaborators.
    I hope to come back when addressables will be more stable, keep up the good work and thanks for helping me.
     
  8. vitorfgd

    vitorfgd

    Joined:
    Nov 4, 2014
    Posts:
    27
    @unity_bill can you confirm this is fixed on 1.3.8 and/or 1.4. I'm still getting the same error on my webgl project.

    [EDIT] I'm also getting this error on packed mode (now called existing groups.)
     
    Last edited: Nov 25, 2019
  9. leonardo-scur-dot

    leonardo-scur-dot

    Joined:
    Nov 20, 2018
    Posts:
    3
    Can confirm! Even after cleaning and rebuilding content, I still get the error.
     
  10. vitorfgd

    vitorfgd

    Joined:
    Nov 4, 2014
    Posts:
    27
    I was investigating the problem and it seems to be related to the RemoteLoadPath and RemoteBuildLoad I was using.

    In order to be path relative I used content/[BuildTarget] for building and loading content and as soon as I changed it to an absolute path such as www.mywebsite.com/content/[BuildTarget] it worked.

    Care to explain why is that?