We have a project we are testing in Unity v5.6.0f3 which builds a large number of assetbundles.
Up to this point, this project has been able to build assetbundles for individual assets efficiently and quickly using the (now obsolete) BuildPipeline.BuildAssetBundle() function. Now we are trying to use the 5.x version with BuildAssetBundles() however each time we do this, it forces a reimport of sorts:
“Hold on: Determining assets that need to be reimported for target platform”
“Hold on: Calcuating asset hashes”
This happens even if only a single assetbundle is built.
This would render the entire project useless because of the time it takes to perform these calcuations. Is this a bug? A single assetbundle shouldn’t take over a minute to build.
This happens whether we use the SetAssetbundleNameandVariant API or build the assetbundle(s) using a Build Map.
FWIW we use the 5.x assetbundle system in a separate project in v5.3.7 w/o problems.
I will save my gripe about losing the BuildAssetBundle() capability for another day
As far as reimport, I’m using Unity’s asset bundle manager from the asset store. It might be a little outdated, but it includes a menu option to build asset bundles and it doesn’t trigger a reimport. Usually it works pretty quickly depending on what I’m bundling and how much I’m bundling. I have noticed every so often it takes a little longer the first time I build after opening a project fresh for the day, but it’s usually a short delay, so I don’t notice it much.
Yeesh… I may be losing my mind. I swore in a beta test or something of 5.6, the project wouldn’t compile because BuildAssetBundle() was rendered obsolete. It looks like, though marked as obsolete, it still works in the final version so I happily stand corrected on that point (for now). I hope Unity opts to keep supporting it.
In terms of the reimport, it looks as though NOT specifying a build target in BuildAssetBundles() causes the reimport. I assumed the build target would default to the current platform but apparently it doesnt properly build them at all (or at least does so after a reimport). Either way, specifying the build target seems to work as intended so that’s my bad as well. Thanks.
in their build script that came with the asset, so that’s probably why I never noticed a reimport. Good info to have in the future though in case that asset ever has issues for me and they don’t update it.
We are no longer using the BuildAssetBundles API but the automatic reimport was happening because we weren’t specifying a build target in the function call.
this happend to me with the assets bundle browser… i never switched the plataform and its on standalone windows but seems that every time when i want to build an assets bundle its takes too long start to doing that reimporting of plataform when it should not do it … its FRUSTRATING AND DAMN ITS TAKE LONG TIME TO WORK LIKE THIS … and all of this im using assets bundle coz unity limit us 4gb texture data
same for me… spending 10 minutes or more to build a single asset bundle due to re-import, calculating asset hashes, downloading from the cache server, etc… all for a single 20MB material to be put into a bundle containing only 2 assets… And yes, all this because I hit the 4GB limit. My build now takes many many hours to complete, for just 500 materials (each into its own bundle). Need a solution.
I am specifying the build target, and this still occurs…
I think this may happen when your project is targeted for something other than what you are targeting for BuildAssetBundles.
For example, if your project platform is set for Windows Standalone but you start building assetbundles targeted for WebGL, the Editor will have to package those assets for WebGL and then re-import them and recalculate hashes back for your project (i.e, Windows).
This same thing seems to happen to me, but for no apparent reason. It will happen what seems to be completely randomly every 5 to 20 builds. Sometimes 2 or 3 times in a row! I’m not changing or re-importing any assets at all, or changing any build settings. Nor am I using any special buildassetbundles related stuff. Does anybody know why this is/could be happening? Any help would be very greatly appreciated!
Has anyone found any solutions to this?
My team is on unity 2017.4.22 and one of our machines can build the asset bundles just fine, whereas every other machine needs to reimport all assets and rebuild all asset bundles.
Edit: It turns out that the asset bundle browser plugin thinks there is a difference between windowsStandalone and WindowsStandalone 64bit asset bundles. We resolved our issue by forcing the bundle build target to be the editors current build target.
It seems in new asset bundle system there’s no option to build single asset bundle with dependencies. I was thinking of separate machine for building bundles when saw this thread. Seems no solution here too…