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
Opening file failed Opening file archive:/CAB-ca6e2cdc278a53641b19581a975bffc5/CAB-ca6e2cdc278a53641
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):
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.
Closing file : The operation completed successfully.
: archive:/CAB-71bbfc38d3099bc9936136c7dea37c0c/CAB-71bbfc38d3099bc9936136c7dea37c0c.resS.
Could not open file archive:/CAB-71bbfc38d3099bc9936136c7dea37c0c/CAB-71bbfc38d3099bc9936136c7dea37c0c.resS for read.
The DisplayDialog is this function: Unity - Scripting API: EditorUtility.DisplayDialog
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).
I have the same problem. Only occurs in ios and windows, android and editor is ok. Isn’t LoadAsset synchronous? So weird.
As anyone report this bug to Unity? I can reproduce this error as well.
assetloading is a key component of what my application is doing and I got this bug as well.
Did you rebuild your asset bundles?
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.
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
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!
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.
me too, some errors case by assetbundle.Unload(false) and sometime it’ will happen an sometime not.
Has anyone solved this problem?
We have the same problem in unity 2017.1.2
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.
I’m having this issue and error too. It’s assetbundle related for sure.
just call unload(false) a few seconds(ex:0.001f) or one or two frames later works fine for me
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.
hello, this problem can u solved? i meet same condition, can u give me some help? i delete unload, alse have problem …
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.