Search Unity

Are Unity AssetBundles Supported on 5.5.0f3 HoloLens Build?

Discussion in 'VR' started by spinteractive, Dec 7, 2016.

  1. spinteractive

    spinteractive

    Joined:
    Dec 19, 2015
    Posts:
    75
    We need to load content dynamically using AssetBundles.

    I'm doing this..

    Code (CSharp):
    1.  
    2. using UnityEditor;
    3.  
    4. public class CreateAssetBundles {
    5.  
    6.     [MenuItem("Assets/Build AssetBundles")]
    7.     static void BuildAllAssetBundles()
    8.     {
    9.         BuildPipeline.BuildAssetBundles("Assets/AssetBundles", BuildAssetBundleOptions.None, BuildTarget.WSAPlayer);
    10.     }
    11. }
    and getting: Error building Player because scripts have compile errors in the editor
     
  2. unity_andrewc

    unity_andrewc

    Unity Technologies

    Joined:
    Dec 14, 2015
    Posts:
    223
    Is this script in your project's Assets\Editor folder? See https://docs.unity3d.com/Manual/SpecialFolders.html.

    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.
     
  3. spinteractive

    spinteractive

    Joined:
    Dec 19, 2015
    Posts:
    75
    I started over. Now I'm using the AssetBundleManager found here: https://www.assetstore.unity3d.com/en/#!/content/45836

    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?
     
    Last edited: Dec 7, 2016
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    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.
     
  5. spinteractive

    spinteractive

    Joined:
    Dec 19, 2015
    Posts:
    75
    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?
     
  6. spinteractive

    spinteractive

    Joined:
    Dec 19, 2015
    Posts:
    75
    I went real basic and now have BuildAllAssetBundles() working just fine in my HoloLens Unity 5.50f3 project!
     
    Hodgson_SDAS likes this.
  7. gfagnani

    gfagnani

    Joined:
    Aug 2, 2018
    Posts:
    1
    HOW??????
     
  8. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,983
    I also want to know how to get assetbundles working in build, it crashes anytime we include them...
     
  9. NoahTheProgrammer

    NoahTheProgrammer

    Joined:
    Jun 9, 2014
    Posts:
    3
    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)
     
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Looks like an exception in your code?