ABSystem
ABSystem copied to clipboard
我想问下,有个资源加载的时候出现这个错误,其他资源就不会。
AsyncUploadManager: Failed to close file archive:/CAB-020b3b51eeb82f5f87f9c0f95e001576/CAB-020b3b51eeb82f5f87f9c0f95e001576.resS. Ensure all async operations are complete before unloading bundles.是什么原因呢
没遇到过,AsyncUploadManager
是你项目的代码吧
好像有时候极低的概率是可以加载出来的,但是大部分是有错的。错的分两种: 有时候出现这个错误: Assertion failed: Cancelling DisplayDialog because it was run from a thread that is not the main thread: Opening file failed Opening file archive:/CAB-020b3b51eeb82f5f87f9c0f95e001576/CAB-020b3b51eeb82f5f87f9c0f95e001576.resS: 操作成功完成。 Closing file : 操作成功完成。 : archive:/CAB-020b3b51eeb82f5f87f9c0f95e001576/CAB-020b3b51eeb82f5f87f9c0f95e001576.resS Could not open file archive:/CAB-020b3b51eeb82f5f87f9c0f95e001576/CAB-020b3b51eeb82f5f87f9c0f95e001576.resS for read 有时候又出现这个错误: AsyncUploadManager: Failed to close file archive:/CAB-020b3b51eeb82f5f87f9c0f95e001576/CAB-020b3b51eeb82f5f87f9c0f95e001576.resS. Ensure all async operations are complete before unloading bundles. UnityEngine.AssetBundle:Unload(Boolean) Tangzx.ABSystem.AssetBundleInfo:UnloadBundle() (at Assets/ABSystem/Scripts/AssetBundle/AssetBundleInfo.cs:292) Tangzx.ABSystem.AssetBundleInfo:get_mainObject() (at Assets/ABSystem/Scripts/AssetBundle/AssetBundleInfo.cs:279) CaomaoFramework.<Create>c__AnonStorey0:<>m__0(AssetBundleInfo) (at Assets/Scripts/Framework/UIManager/UIBase.cs:128) AssetBundleLoader:FireEvent() (at Assets/ABSystem/Scripts/AssetBundle/AssetBundleLoader.cs:106) AssetBundleLoader:Complete() (at Assets/ABSystem/Scripts/AssetBundle/AssetBundleLoader.cs:90) MobileAssetBundleLoader:Complete() (at Assets/ABSystem/Scripts/AssetBundle/AssetBundleLoader.cs:285) <LoadFromCachedFile>c__Iterator0:MoveNext() (at Assets/ABSystem/Scripts/AssetBundle/AssetBundleLoader.cs:217) UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
是不是异步加载卸载造成的
如果我把: void UnloadBundle() { if (bundle != null) { if (WWWResourceManager.enableLog) Debug.Log("Unload : " + data.compositeType + " >> " + data.debugName);
bundle.Unload(false);
}
bundle = null;
}
的bundle.Unload(false)注释了就不会有错误
这个问题倒是没遇见过。Ensure all async operations are complete before unloading bundles.
重点可能在这,你有没有改ABSystem源码,或者多个ab系统共存了,导致一边在加载一边在卸载?
能加个qq聊下吗,好像只有这个资源有问题。其他资源就没问题,很奇怪
大佬,在吗?又有问题,就是场景加载后,加载的UI就会变形。是场景加载时会卸载AB吗,我已经将UI设置为DontDestory了,为啥还会卸载?
这是新版unity的问题,主要是加载ab里面的纹理,然后立即unload(false),延迟unload就行了
发现新版本Unity 有同样的问题,总是概率性出现这个错误
I think it is relate https://forum.unity.com/threads/opening-file-failed-opening-file-archive-cab-ca6e2cdc278a53641b19581a975bffc5-cab-ca6e2cdc278a53641.488402/