Search Unity

Opening file failed Opening file archive:/CAB-ca6e2cdc278a53641b19581a975bffc5/CAB-ca6e2cdc278a53641

Discussion in 'Editor & General Support' started by wangqiwei, Aug 16, 2017.

  1. wangqiwei

    wangqiwei

    Joined:
    Aug 16, 2017
    Posts:
    1
    hi all, after i upgraded the unity from 5.4.3 to 2017.1.0.p2, there were something wrong in the builded package,
    here are the errors:
    Assertion failed: Cancelling DisplayDialog because it was run from a thread that is not the main thread: Opening file failed Opening file archive:/CAB-ca6e2cdc278a53641b19581a975bffc5/CAB-ca6e2cdc278a53641b19581a975bffc5.resS:
    Closing file : 操作成功完成。
    : archive:/CAB-ca6e2cdc278a53641b19581a975bffc5/CAB-ca6e2cdc278a53641b19581a975bffc5.resS
    Could not open file archive:/CAB-ca6e2cdc278a53641b19581a975bffc5/CAB-ca6e2cdc278a53641b19581a975bffc5.resS for read
    ........
    i use "AssetBundle.LoadFromFileAsync" to read the bundles. and it is correct in unity editor and android package,
    but it is wrong in windows and ios package.
    so what's the problem, can you help me, thanks
     
  2. steven3Dim

    steven3Dim

    Joined:
    Feb 21, 2017
    Posts:
    12
    I have the same problem when I upgraded to 2017. I don't know exactly what triggers the error. Only a different file (but the same name all the time):
    Code (CSharp):
    1. Assertion failed: Cancelling DisplayDialog because it was run from a thread that is not the main thread: Opening file failed Opening file archive:/CAB-71bbfc38d3099bc9936136c7dea37c0c/CAB-71bbfc38d3099bc9936136c7dea37c0c.resS: The operation completed successfully.
    Code (CSharp):
    1. Closing file : The operation completed successfully.
    2.  : archive:/CAB-71bbfc38d3099bc9936136c7dea37c0c/CAB-71bbfc38d3099bc9936136c7dea37c0c.resS.
    Code (CSharp):
    1. Could not open file archive:/CAB-71bbfc38d3099bc9936136c7dea37c0c/CAB-71bbfc38d3099bc9936136c7dea37c0c.resS for read.
     
  3. steven3Dim

    steven3Dim

    Joined:
    Feb 21, 2017
    Posts:
    12
  4. steven3Dim

    steven3Dim

    Joined:
    Feb 21, 2017
    Posts:
    12
    It happens when we load a texture from an assetbundel with LoadAsset and then close the assetbundle with bundle.Unload(false);. Only for large(~120 MB) asset bundles it seems that LoadAsset secretly uses an asynchronous load function and, when we unload the bundle, this results in an error. When you look in the logfile of a build (output_log.txt inside your data directory of your build) you can see an error for the specific bundle it tried to open (you don't see this in editor mode).
     
    vibedev likes this.
  5. xmxiaoq

    xmxiaoq

    Joined:
    Aug 17, 2017
    Posts:
    1
    I have the same problem. Only occurs in ios and windows, android and editor is ok. Isn't LoadAsset synchronous? So weird.
     
    Last edited: Sep 8, 2017
  6. sstephane

    sstephane

    Joined:
    Nov 5, 2009
    Posts:
    30
    As anyone report this bug to Unity? I can reproduce this error as well.
     
  7. unity_DaSkUgCc4s_JAg

    unity_DaSkUgCc4s_JAg

    Joined:
    Sep 22, 2017
    Posts:
    3
    assetloading is a key component of what my application is doing and I got this bug as well.
     
  8. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    4,780
    Did you rebuild your asset bundles?
     
  9. unity_DaSkUgCc4s_JAg

    unity_DaSkUgCc4s_JAg

    Joined:
    Sep 22, 2017
    Posts:
    3
    Yes I did rebuild them with the same version of unity I am loading them with. The strange thing is that the mesh seems to load (despite the error) but after that the async loading of a texture fails. In the editor the error happens sometimes, so if I reload the same file a couple of times the error does or doesn't happen each try. A compiled build always fails for certain files. The code worked fine in 5.6.0 but after the update it doesn't. I am 100% sure I did not change the code because GIT doesn't register any changes either.
     
  10. unity_DaSkUgCc4s_JAg

    unity_DaSkUgCc4s_JAg

    Joined:
    Sep 22, 2017
    Posts:
    3
    In case someone else is visiting this thread, having the same problem:
    a clean uninstall (uninstall, deleting unitys preferences in Users/Username/AppData/Roaming/Unity, delete every unity folder you can find in ProgramFiles, CCleaner once) and reinstalling Unity (not 2017 but 5.6.3) was doing the trick for me
     
    Last edited: Sep 25, 2017
  11. Mockarutan_

    Mockarutan_

    Joined:
    Apr 26, 2017
    Posts:
    1
    I have the same issue, but we use a special home-made bundle system in the editor for all our assets during development. So I get it in the editor for ~200 object when I try to build our assets database.

    I tried purging everything and reinstalling Unity, no luck. If anyone have any idea, please share!
     
  12. pavlisf

    pavlisf

    Joined:
    Oct 4, 2017
    Posts:
    1
    Hey guys,

    we had exactly the same issues. And we have found that it was caused by calling AssetBundle.Unload(false) right after we've loaded all the assets from a bundle. Removing that (not great, I know) solved the problem. I have filed a bug on Unity.
     
  13. DA_Uncle

    DA_Uncle

    Joined:
    Feb 18, 2017
    Posts:
    3
    me too, some errors case by assetbundle.Unload(false) and sometime it' will happen an sometime not.
     
  14. tcvpromo

    tcvpromo

    Joined:
    Jun 7, 2017
    Posts:
    17
    Has anyone solved this problem?
    We have the same problem in unity 2017.1.2
     
  15. bgm0

    bgm0

    Joined:
    Jan 6, 2015
    Posts:
    1
    The exactly same problem appeared in my project.
    I just changed the method to load image from assetbundle and it worked!!!
    Try to use assetbundle.LoadAssetAsync instead of assetbundle.LoadAsset.
     
    ali_solis and eiji-satake like this.
  16. LukeDawn

    LukeDawn

    Joined:
    Nov 10, 2016
    Posts:
    333
    I'm having this issue and error too. It's assetbundle related for sure.
     
  17. skycc

    skycc

    Joined:
    Oct 1, 2010
    Posts:
    11
    just call unload(false) a few seconds(ex:0.001f) or one or two frames later works fine for me
     
    Last edited: Jan 24, 2018
  18. LukeDawn

    LukeDawn

    Joined:
    Nov 10, 2016
    Posts:
    333
    Sorted! Putting your assetbundle read/load method into a coroutine and yielding for one or two frames directly before your ab.unload(false); will solve this issue completely.

    Unity must be doing something on a separate thread, which takes an extra frame, so if you close your bundle before whatever background magic is going off, you get the errors.
     
    teohaneksi and charlesLi like this.
  19. charlesLi

    charlesLi

    Joined:
    Feb 7, 2013
    Posts:
    6
    hello, this problem can u solved? i meet same condition, can u give me some help? i delete unload, alse have problem ....
     
    Serhii-Horun likes this.
  20. LukeDawn

    LukeDawn

    Joined:
    Nov 10, 2016
    Posts:
    333
    You need to wait for Unity to finish it's importing of textures (done on a different thread), before you unload the assetbundle. I found a simple yield return new waitforseconds(0.1f); before the unload was sufficient to cure the issue. It's definitely a Unity bug.
     
    Serhii-Horun and duyankai like this.
  21. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,464
    Have you filed a bug report?
     
  22. charlesLi

    charlesLi

    Joined:
    Feb 7, 2013
    Posts:
    6
    upload_2018-3-14_9-53-35.png i directly delete this "unload()", then Problem still exist, happen sometims,curiously
     
  23. charlesLi

    charlesLi

    Joined:
    Feb 7, 2013
    Posts:
    6
    hello, Karl Jones, this Problem Happened after i upgraded the unity from 5.6.4 to 2017.3.1.p3, there were something wrong in the builded package. the same project , i use 5.6.4 is ok, when use 2017 hanppen error, like other.
     

    Attached Files:

  24. charlesLi

    charlesLi

    Joined:
    Feb 7, 2013
    Posts:
    6
    hello, Karl Jones, "Assertion failed: Cancelling DisplayDialog because it was run from a thread that is not the main thread: Opening file failed Opening file archive" . there is a testproject fo this problem, can u help check this Bug?
    if u need more info, please email m, liwei03@mail.jj.cn
     

    Attached Files:

  25. liber-isogai

    liber-isogai

    Joined:
    Mar 14, 2018
    Posts:
    4
    I have the same problem by updating from Unity 5.3 to Unity 2017.3.

    AssetBundle.Unload(false)
    --------------------------------------
    UnityEditor Android(Unity2017) + AssetBundle(Unity2017)-> OK
    UnityEditor iOS(Unity2017) + AssetBundle(Unity2017)-> NG
    UnityEditor iOS(Unity2017) + AssetBundle(Unity5.3)-> OK
     
  26. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,464
    liber-isogai likes this.
  27. liber-isogai

    liber-isogai

    Joined:
    Mar 14, 2018
    Posts:
    4
    karl_jones likes this.
  28. Matti-Jokipii

    Matti-Jokipii

    Joined:
    Apr 24, 2015
    Posts:
    15
    What a piece of crap.
     
  29. kent_omichi

    kent_omichi

    Joined:
    Jan 21, 2014
    Posts:
    1
  30. Mindslicer

    Mindslicer

    Joined:
    May 2, 2018
    Posts:
    4
    Got this bug when I switching focus from editor to Visual Studio after Open/Close SQLite database connection calling
     
  31. Serhii-Horun

    Serhii-Horun

    Joined:
    Apr 12, 2015
    Posts:
    85
    Fixed for me
     
  32. liber-isogai

    liber-isogai

    Joined:
    Mar 14, 2018
    Posts:
    4
  33. liber-isogai

    liber-isogai

    Joined:
    Mar 14, 2018
    Posts:
    4
  34. Chico3001

    Chico3001

    Joined:
    Mar 10, 2018
    Posts:
    2
    Unity 2018.2.2f1 still has the same error...
     
  35. onkelv

    onkelv

    Joined:
    Sep 29, 2016
    Posts:
    7
    Is there also a workarround for non coroutine methods?
     
  36. the-forty-seven

    the-forty-seven

    Joined:
    Nov 12, 2014
    Posts:
    6
    Delaying unloading for several frames or seconds can greatly reduce the frequency of this problem. But it still happens.
    I need another option except upgrade to 2018.3 Can anyone help?
     
  37. JohnSonLi

    JohnSonLi

    Joined:
    Apr 15, 2012
    Posts:
    586
    which version fix this ??2017.3.0p2 is not fixed yet.
     
  38. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,464
    Its not fixed in 2017.3, its in 2017.4.21f1
     
  39. ZhengzhongSun

    ZhengzhongSun

    Joined:
    Oct 12, 2016
    Posts:
    17
    But 2018.2.1f1 still have this problem
     
  40. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,464
    It should be fixed in 2018.3+.
     
  41. cnmuna

    cnmuna

    Joined:
    Mar 6, 2017
    Posts:
    3
    yielding 1,2 frames before unloading assets works for me as well (unity 2018.2.13)
     
  42. lostplesed

    lostplesed

    Joined:
    Mar 26, 2014
    Posts:
    18
    i load and unload ab in the same frame still had this problem.
    2018.4.1f1 LTS version
    any method instead of yielding frame can fix it??
     
  43. Jhon_JQ

    Jhon_JQ

    Joined:
    Jul 24, 2018
    Posts:
    3
    2018.4.7f1 still have this problem
     
  44. LukeDawn

    LukeDawn

    Joined:
    Nov 10, 2016
    Posts:
    333
    I call a delay coroutine with the assetbundle as a parameter; which yields a few frames before closing. Stopped the problem.