I tried load an AssetBundle by using LoadFromFileAsync, but found AssetBundle.LoadFromFileAsync block the main thread. This is unexpected or expected?
Hi, the screenshot is not enough to find the root cause. Which platform did this happen? Do you have the native callstacks of all threads when the main thread is blocking?
Hi, Alan, how to get native callstacks of all threads?
It depends on the platform the game running on. Which platform is the game running?
Android Phone
I just noticced that from the screenshot, it seems the main thread was not blocking forever. If it’s true, maybe the native callstacks are not needed.
I saw there are many brown blocks under Loading.ReadObjectThreaded. If you click those blocks, Unity should show some information about it, can you post them here?
Are other threads busy when the main thread blocks? Maybe main thread is waiting for them to finish some jobs. If there are such threads, the information of them is also needed.
P.S.
To get native callstacks on Android, you can generate a gradle project for building development player. In Android Studio, use the project to run the built player on Android device with debugger attached. When the game blocks, you can pause the debugger, then the native callstacks will show in the Android Studio.