Can not load scene from AssetBundle (3.8.0 - 3.8.2)

I tried everything I can to load the scene in the bundle (web-mobile) and it never works in a Release build. Still working correctly in debug builds though.

  • Sometimes, the scene is missing from build build (I tried to load all the scenes in bundle and it returns an empty array).
  • Tried to delete everything (library, settings, temp …) and report seems to make it some what better (the scenes are now appear from the array). And I were able to getSceneInfo.
  • Even tried to load an empty scene to make sure it’s not the script that caused problems, not working though
  • Even tried to rename the scene, put inside a sub folder, still not working
  • Even tried to fix the permission thing (chmod 777) just in case the file is unreadble

  • It’s obviously the scene is not missing because as we can see from the log, all the meta / info is there
  • And now it’s tellling me that the loaded Object is not a SceneAsset

What should I do now? are there any workaround? I am experienced with Asset bundles things, though, have been using it for years, and it’s like always working correctly in cocos creator 2.4 and 3.5 or so

Can you show us how you load bundle and scene? And where this log come from, it looks weird.

1 Like

@zzy Here is the code I used to load the scene from bundle.
I don’t think there is a problem with the code, actually.
I tried downgraded the project to Cocos Creator v3.6 and it’s working, so I guess I will stick with CC3.6 for some more time.

Why sceneAsset is an array? It does’t make sense.
And direcotr.runScene(sceneAsset) seemingly not recommend, we use director.loadScene(sceneName);

Hi @thienhaflash your scene is getting corrupt somehow are you releasing assets or scripts ? Although i have an expertise on bundle resources i have spent a month on these issue and internal engine component. i believe i can definitely help you.

1 Like

Thanks for your willingness @chandanKrishnani, unfortunately, I did not figured out what happen and finally reverted to CC3.6 - which is running perfectly.

  • The scene is not corrupted by any mean (I checked for missing script & referencens but no problem has been found). I also tried to load an empty scene, same result, same error.
  • I firstly suspected that there is a problem with the script loading order (the previous bundle some how refer to the scripts in later- yet-to-loaded bundles) but it’s not the case.
  • I do think that there is a problem with the cocos importer, though. Because trying to reimport all resulted in a different error but I do not have time to research further on that

The scene is an asset because it’s in the bundle @zzy and it’s not an array, though.