- Home /
Error building asset bundles in Unity 4.5
I recently upgraded my project from Unity 4.2.1 to 4.5.0
After doing so, I tried to run the asset bundle builder like I normally would but it always spams the following error message:
Are you trying to build bundles from within an AssetPostprocessor? UnityEditor.BuildPipeline:BuildAssetBundleExplicitAssetNames(Object[], String[], String, BuildAssetBundleOptions, BuildTarget) I'm not trying to import assets at this point. I can hit the play button and run the game out of the Unity editor just fine, so an asset import is obviously not underway. Restarting Unity doesn't help. Also tried disabling the cache server to make sure that wasn't causing problems. I'm not using an AssetPostProcessor.Cannot build asset bundles while imports of assets are in progress.
Can you post the code where the asset bundle is being built?
I'm going to trim it down to just the main build call. Otherwise you'd be looking through 1000 lines of code. Is there anything in particular that you're looking for?
BuildPipeline.PushAssetDependencies();
BuildPipeline.BuildAssetBundleExplicitAssetNames(
assetsToBundle,
assetNames,
bundleFileName,
BuildAssetBundleOptions.DisableWriteTypeTree |
BuildAssetBundleOptions.CompleteAssets |
BuildAssetBundleOptions.CollectDependencies |
BuildAssetBundleOptions.Deter$$anonymous$$isticAssetBundle,
profile.GetBuildTarget()
);
BuildPipeline.PopAssetDependencies()
Answer by finally1022 · Jul 18, 2014 at 04:24 PM
I just meet this problem , to solve this , see below
//AssetDatabase.StartAssetEditing();
//AssetDatabase.StopAssetEditing();
you must commented the code, then fixed it;
Your answer
Follow this Question
Related Questions
The file "MemoryStream" is corrupted! unity 4.5 1 Answer
How to find an elusive crash? 2 Answers
How do you fix "The script class couldn't be found" for an AssetPostProcessor DLL ? 1 Answer
How to import the object from server to unity 2 Answers
KeyNotFoundException that makes no sense (*I* can find the key) 0 Answers