Are Unity AssetBundles Supported on 5.5.0f3 HoloLens Build?

We need to load content dynamically using AssetBundles.

I’m doing this…

using UnityEditor;

public class CreateAssetBundles {

    [MenuItem("Assets/Build AssetBundles")]
    static void BuildAllAssetBundles()
    {
        BuildPipeline.BuildAssetBundles("Assets/AssetBundles", BuildAssetBundleOptions.None, BuildTarget.WSAPlayer);
    }
}

and getting: Error building Player because scripts have compile errors in the editor

Is this script in your project’s Assets\Editor folder? See Unity - Manual: Special folder names.

If you still get any errors, information on the errors you get would be useful. “Error building Player because scripts have compiler errors” is a generic error when building if you had other errors, that error alone doesn’t really tell us anything.

I started over. Now I’m using the AssetBundleManager found here: Unity Asset Store - The Best Assets for Game Making

It works fine on a new project with PC platform .

When I switch to Windows Store for HoloLens platform, I cannot build assets anymore and get the following error:

ArgumentNullException: Argument cannot be null.
Parameter name: path2
System.IO.Path.Combine (System.String path1, System.String path2) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Path.cs:115)
AssetBundles.BuildScript.BuildAssetBundles () (at Assets/AssetBundleManager/Editor/BuildScript.cs:19)
AssetBundles.AssetBundlesMenuItems.BuildAssetBundles () (at Assets/AssetBundleManager/Editor/AssetbundlesMenuItems.cs:27)

I think the new Windows Store Platform build does not yet support the AssetBundleManager. Can you confirm?

Asset bundles work on Windows Store just fine. I don’t know about that plugin, though. The error is pretty straightforward though: that script is passing null into System.IO.Path.Combine.

It’s missing the build platform. So I added the WSAPlayer for Windows Store. When I attempted to build it created the path but I’m still getting errors. It’s a very vague error now :
Error building Player because scripts have compile errors in the editor.

It’s definitely specific to Windows Store, if I switch to another platform it works fine.

What would you recommend using to get going quickly with AssetBundle Loading and Building in my HoloLens project?

I went real basic and now have BuildAllAssetBundles() working just fine in my HoloLens Unity 5.50f3 project!

1 Like

HOW???

I also want to know how to get assetbundles working in build, it crashes anytime we include them…

I seem to be getting the same error as @spinteractive and would like to find a fix:

ArgumentNullException: Argument cannot be null.
Parameter name: path2
System.IO.Path.Combine (System.String path1, System.String path2) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Path.cs:115)
AssetBundles.BuildScript.BuildAssetBundles () (at Assets/AssetBundleManager/Editor/BuildScript.cs:19)
AssetBundles.AssetBundlesMenuItems.BuildAssetBundles () (at Assets/AssetBundleManager/Editor/AssetbundlesMenuItems.cs:27)

Looks like an exception in your code?