Editor always crashes while exporting an Android build and generating asset bundles at the same time

Hi,
I’m trying to automate asset bundle generation in a PreProcess script, when exporting a project. Unfortunately, the editor always crashes, when calling BuildPipeline.BuildAssetBundles.

The crash can be easily reproduced. I’ve attached a sample project, where the crash happens every time on my windows box. I’m using Unity 2017.1.0p2 and exporting an Android project with build system: gradle, export project: true.

I’ve also submitted a bug report, case 935893

3162978–240705–Crash.zip (40 KB)

This happens to me after abrupt interrupt a Asset Budnel generation before finishing (like shutting down the whole system while asset bundle generation are still in progress). After that any other try crashes the Unity. So for me just deleting the old bundle file (and yours manifests) solves the problem.