Search Unity

[v1.5.0]crashed when using Addressables.LoadSceneAsync

Discussion in 'Addressables' started by caochao88_unity, Dec 20, 2019.

  1. caochao88_unity

    caochao88_unity

    Joined:
    May 16, 2019
    Posts:
    26
    Boot scene is InitialScene, open it and run game. you first enter the first level scene City_01, which has been added to BuildSettings. And when you scroll to end, then will load next level scene City_02 by Addressables.LoadSceneAsync, which scene is added to addressable group. And will crash now...
    loading code is:
    Code (CSharp):
    1.  private void LoadChapterScene(int chapterId)
    2.         {
    3.             var chapterConfig = _contexts.gameConfig.GetEntityWithChapterItem(chapterId);
    4.             if (chapterConfig != null)
    5.             {
    6.                 //LoadSceneAsync(chapterConfig.chapterItem.SceneAsset);
    7.                 _loadSceneHandle = Addressables.LoadSceneAsync(chapterConfig.chapterItem.SceneAsset);
    8.                 StartCoroutine(LoadRemoteScene());
    9.             }
    10.         }
    Code (CSharp):
    1. private IEnumerator LoadRemoteScene()
    2.         {
    3.             while (!_loadSceneHandle.IsDone)
    4.             {
    5.                 Debug.Log("LoadRemoteScene:" + _loadSceneHandle.PercentComplete);
    6.                 yield return null;
    7.             }
    8.         }
    [solved]AssetBundle is build under iOS platform, and load in editor, incompatible format.
     

    Attached Files:

    Last edited: Dec 23, 2019
  2. caochao88_unity

    caochao88_unity

    Joined:
    May 16, 2019
    Posts:
    26
    need some help, thanks
     
  3. caochao88_unity

    caochao88_unity

    Joined:
    May 16, 2019
    Posts:
    26
    waiting online...
     
  4. caochao88_unity

    caochao88_unity

    Joined:
    May 16, 2019
    Posts:
    26
    any answer?
     
  5. chanon81

    chanon81

    Joined:
    Oct 6, 2015
    Posts:
    168
    Maybe post the console output / exception log?
     
  6. caochao88_unity

    caochao88_unity

    Joined:
    May 16, 2019
    Posts:
    26
    crashed editor log uploaded
     
  7. caochao88_unity

    caochao88_unity

    Joined:
    May 16, 2019
    Posts:
    26
    a little disappointed for the inactived forum
     
  8. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,117
    1) did you tried with 64bit devices ?
    2) does your scene contains any animator and avatar?
    In my case it was crashing only for 32bit devices when loading something containing an avatar like characters. Addressables Team confirmed the bug so as a workaround we just load a character then set it’s avatar at runtime.
     
  9. caochao88_unity

    caochao88_unity

    Joined:
    May 16, 2019
    Posts:
    26
    thanks for your answer. In my case, crash is caused by bundle build platform is not same as runtime platform.
     
    Opeth001 likes this.
  10. Shaunyowns

    Shaunyowns

    Joined:
    Nov 4, 2019
    Posts:
    328
    Hey @caochao88_unity, I've sent this post over to see if I can get a response for you!