Search Unity

Bug AssetBundle.LoadFromFileAsync cause errors or freeze in Editor when built using DisableWriteTypeTree

Discussion in 'Asset Bundles' started by Alan-Liu, Apr 6, 2022.

  1. Alan-Liu

    Alan-Liu

    Joined:
    Jan 23, 2014
    Posts:
    391
    If an asset bundle is built by using BuildAssetBundleOptions.DisableWriteTypeTree, calling AssetBundle.LoadFromAsync to load it will cause errors or freeze in editor:
    Code (CSharp):
    1. Assertion failed on expression: 'CurrentThreadIsMainThread()'
    2. 0x00007ff7b10fbdec (Unity) StackWalker::GetCurrentCallstack
    3. 0x00007ff7b11031e9 (Unity) StackWalker::ShowCallstack
    4. 0x00007ff7b1e6d74c (Unity) GetStacktrace
    5. 0x00007ff7b28ba5e3 (Unity) DebugStringToFile
    6. 0x00007ff7b28ba302 (Unity) AssertImplementation
    7. 0x00007ff7b0fe754f (Unity) MonoScriptManager::GetAllRuntimeScripts
    8. 0x00007ff7b102ad70 (Unity) ScriptingManager::UpdateScriptHashes
    9. 0x00007ff7b063f935 (Unity) TestAssetBundleCompatibility
    10. 0x00007ff7b064e53b (Unity) AssetBundleLoadFromAsyncOperation::Perform
    11. 0x00007ff7b0d9f94b (Unity) PreloadManager::ProcessSingleOperation
    12. 0x00007ff7b0d9ffc6 (Unity) PreloadManager::Run
    13. 0x00007ff7b0ee2355 (Unity) Thread::RunThreadWrapper
    14. 0x00007fff0fda7c24 (KERNEL32) BaseThreadInitThunk
    15. 0x00007fff1028d721 (ntdll) RtlUserThreadStart
    Both the assetbundles built by BuildPipeline.BuildAssetBundles and Addressables (I modified the source code to disable TypeTree) have this issue.
     
    Last edited: Apr 6, 2022
  2. Alan-Liu

    Alan-Liu

    Joined:
    Jan 23, 2014
    Posts:
    391