Search Unity

AssetBundle Manger - Local Server Broken On Windows 10

Discussion in 'Asset Bundles' started by nindim, Jan 4, 2017.

  1. nindim

    nindim

    Joined:
    Jan 22, 2013
    Posts:
    130
    Hi,

    Some background:
    I am trying to implement App Slicing into my already released game (Super Powerboy) in the hope I can reduce the size on iPhone at least. I'm planning on having AssetBundle variants included in my Universal binary which (if I understand correctly) should then get removed/added as necessary for different devices. I'd rather not mess with On Demand Resources at this stage, I am looking for the simplest way to achieve App Slicing, which seems to be following this blog post: https://blogs.unity3d.com/2015/12/28/optimizing-ios-app-size-with-resource-slicing/

    The Issue:
    Is the local asset bundle server expected to work with Unity 5.5? I am running Windows 10 and am running into lots of issues. I have built the bundles and then tried to switch to local server mode and play the variant test scene.

    I don't think the local server is actually running (the option in the menu does not get a tick like the SImulation mode), when I click "Load SD" or "Load HD", I get the errors below:

    Failed downloading bundle Windows from http://<MyIP>:7888/Windows/Windows: Failed to connect to <MyIP> port 7888: Connection refused
    UnityEngine.Debug:LogError(Object)
    AssetBundles.AssetBundleLoadAssetOperationFull:IsDone() (at Assets/AssetBundleManager/AssetBundleLoadOperation.cs:190)
    AssetBundles.AssetBundleLoadOperation:MoveNext() (at Assets/AssetBundleManager/AssetBundleLoadOperation.cs:17)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

    and

    NullReferenceException: Object reference not set to an instance of an object
    AssetBundles.AssetBundleManager.RemapVariantName (System.String assetBundleName) (at Assets/AssetBundleManager/AssetBundleManager.cs:251)
    AssetBundles.AssetBundleManager.LoadLevelAsync (System.String assetBundleName, System.String levelName, Boolean isAdditive) (at Assets/AssetBundleManager/AssetBundleManager.cs:495)
    LoadVariants+<InitializeLevelAsync>c__Iterator2.MoveNext () (at Assets/AssetBundleSample/Scripts/LoadVariants.cs:90)
    UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    <BeginExample>c__Iterator0:MoveNext() (at Assets/AssetBundleSample/Scripts/LoadVariants.cs:56)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

    I'm also getting errors like this when I try to go back to Simulation mode:

    ArgumentException: Can't find process with ID 1832
    System.Diagnostics.Process.GetProcessById (Int32 processId)
    AssetBundles.LaunchAssetBundleServer.IsRunning () (at Assets/AssetBundleManager/Editor/LaunchAssetBundleServer.cs:48)
    AssetBundles.LaunchAssetBundleServer.ToggleLocalAssetBundleServerValidate () (at Assets/AssetBundleManager/Editor/LaunchAssetBundleServer.cs:38)

    It seems like it could be something to do with permissions, but I haven't got it to work yet. Some other people have had the problem, but none of the solutions have worked for me.

    http://answers.unity3d.com/questions/1282205/invalid-asset-bundle-and-downloading-failed-connec.html
    http://answers.unity3d.com/questions/1183910/cant-run-local-asset-bundle-server.html
    https://forum.unity3d.com/threads/cannot-launch-local-assetbundle-server-cant-find-process.445942/

    A reply on the the second page seems to indicate this was a problem in Unity 5.4 as well. So maybe it's just common to Windows 10?

    Any help would be appreciated!
     
  2. nindim

    nindim

    Joined:
    Jan 22, 2013
    Posts:
    130
    I have just downloaded the most up to date version of the AssetBundle Demo from the BitBucket repro (ass opposed to from the asset store).

    There was a recent fix to the local server so it uses the correct mono profile (https://bitbucket.org/Unity-Technol...mits/bd413ad2caeb420bb2923ab940e61cc9f91ef45d), but unfortunately this does not fix the issue I am experiencing.

    The server did prompt me to let it through the firewall and it now has a tick nxt to it in the Assets submenu, but still no luck at runtime.

    Is there anyway I can report issues with the AssetBundleDemo direct? I thought there would be an issue tracker in the repo on BitBucket, but it looks like it has been disabled? The UnityTestTools repo on the other hand has access to it... Maybe opening this up to the public would be a good thing? Reporting bugs for something not included with the actual engine via the standard bug reporting process doesn't seem like the right thing to do.

    Here are the logs I get when I press the "Load SD" button in the VariantLoader scene:

    upload_2017-1-11_14-1-50.png

    [AssetBundleManager] Simulation Mode: Disabled
    UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:Log(Object)
    AssetBundles.AssetBundleManager:Log(LogType, String) (at Assets\AssetBundleManager\AssetBundleManager.cs:131)
    AssetBundles.AssetBundleManager:Initialize(String) (at Assets\AssetBundleManager\AssetBundleManager.cs:281)
    AssetBundles.AssetBundleManager:Initialize() (at Assets\AssetBundleManager\AssetBundleManager.cs:271)
    <Initialize>c__Iterator1:MoveNext() (at Assets\AssetBundleSample\Scripts\LoadVariants.cs:127)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at C:\buildslave\unity\build\Runtime\Export\Coroutines.cs:17)
    UnityEngine.MonoBehaviour:StartCoroutine_Auto_Internal(IEnumerator)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) (at C:\buildslave\unity\build\artifacts\generated\common\runtime\MonoBehaviourBindings.gen.cs:54)
    <BeginExample>c__Iterator0:MoveNext() (at Assets\AssetBundleSample\Scripts\LoadVariants.cs:68)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at C:\buildslave\unity\build\Runtime\Export\Coroutines.cs:17)
    UnityEngine.MonoBehaviour:StartCoroutine_Auto_Internal(IEnumerator)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) (at C:\buildslave\unity\build\artifacts\generated\common\runtime\MonoBehaviourBindings.gen.cs:54)
    LoadVariants:OnGUI() (at Assets\AssetBundleSample\Scripts\LoadVariants.cs:47)
    (Filename: Assets/AssetBundleManager/AssetBundleManager.cs Line: 131)

    [AssetBundleManager] Loading Asset Bundle Manifest: Windows
    UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:Log(Object)
    AssetBundles.AssetBundleManager:Log(LogType, String) (at Assets\AssetBundleManager\AssetBundleManager.cs:131)
    AssetBundles.AssetBundleManager:LoadAssetBundle(String, Boolean) (at Assets\AssetBundleManager\AssetBundleManager.cs:309)
    AssetBundles.AssetBundleManager:Initialize(String) (at Assets\AssetBundleManager\AssetBundleManager.cs:293)
    AssetBundles.AssetBundleManager:Initialize() (at Assets\AssetBundleManager\AssetBundleManager.cs:271)
    <Initialize>c__Iterator1:MoveNext() (at Assets\AssetBundleSample\Scripts\LoadVariants.cs:127)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at C:\buildslave\unity\build\Runtime\Export\Coroutines.cs:17)
    UnityEngine.MonoBehaviour:StartCoroutine_Auto_Internal(IEnumerator)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) (at C:\buildslave\unity\build\artifacts\generated\common\runtime\MonoBehaviourBindings.gen.cs:54)
    <BeginExample>c__Iterator0:MoveNext() (at Assets\AssetBundleSample\Scripts\LoadVariants.cs:68)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at C:\buildslave\unity\build\Runtime\Export\Coroutines.cs:17)
    UnityEngine.MonoBehaviour:StartCoroutine_Auto_Internal(IEnumerator)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) (at C:\buildslave\unity\build\artifacts\generated\common\runtime\MonoBehaviourBindings.gen.cs:54)
    LoadVariants:OnGUI() (at Assets\AssetBundleSample\Scripts\LoadVariants.cs:47)
    (Filename: Assets/AssetBundleManager/AssetBundleManager.cs Line: 131)

    Loading SD
    UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:Log(Object)
    LoadVariants:OnGUI() (at Assets\AssetBundleSample\Scripts\LoadVariants.cs:48)
    (Filename: Assets/AssetBundleSample/Scripts/LoadVariants.cs Line: 48)

    Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.006667 seconds (Nothing changed)
    Failed downloading bundle Windows from http://192.168.1.114:7888/Windows/Windows: Windows is not a valid asset bundle.
    UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:LogError(Object)
    AssetBundles.AssetBundleLoadAssetOperationFull:IsDone() (at Assets\AssetBundleManager\AssetBundleLoadOperation.cs:351)
    AssetBundles.AssetBundleLoadOperation:MoveNext() (at Assets\AssetBundleManager\AssetBundleLoadOperation.cs:24)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at C:\buildslave\unity\build\Runtime\Export\Coroutines.cs:17)
    (Filename: Assets/AssetBundleManager/AssetBundleLoadOperation.cs Line: 351)

    [AssetBundleManager] Loading VariantScene from variants/variant-scene bundle
    UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:Log(Object)
    AssetBundles.AssetBundleManager:Log(LogType, String) (at Assets\AssetBundleManager\AssetBundleManager.cs:131)
    AssetBundles.AssetBundleManager:LoadLevelAsync(String, String, Boolean) (at Assets\AssetBundleManager\AssetBundleManager.cs:628)
    <InitializeLevelAsync>c__Iterator2:MoveNext() (at Assets\AssetBundleSample\Scripts\LoadVariants.cs:139)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at C:\buildslave\unity\build\Runtime\Export\Coroutines.cs:17)
    UnityEngine.MonoBehaviour:StartCoroutine_Auto_Internal(IEnumerator)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) (at C:\buildslave\unity\build\artifacts\generated\common\runtime\MonoBehaviourBindings.gen.cs:54)
    <BeginExample>c__Iterator0:MoveNext() (at Assets\AssetBundleSample\Scripts\LoadVariants.cs:74)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at C:\buildslave\unity\build\Runtime\Export\Coroutines.cs:17)
    (Filename: Assets/AssetBundleManager/AssetBundleManager.cs Line: 131)

    NullReferenceException: Object reference not set to an instance of an object
    at AssetBundles.AssetBundleManager.RemapVariantName (System.String assetBundleName) [0x00006] in C:\Users\Niall\Downloads\Unity-Technologies-assetbundledemo-0bb0dc961089\Unity-Technologies-assetbundledemo-0bb0dc961089\demo\Assets\AssetBundleManager\AssetBundleManager.cs:372
    at AssetBundles.AssetBundleManager.LoadLevelAsync (System.String assetBundleName, System.String levelName, Boolean isAdditive) [0x00050] in C:\Users\Niall\Downloads\Unity-Technologies-assetbundledemo-0bb0dc961089\Unity-Technologies-assetbundledemo-0bb0dc961089\demo\Assets\AssetBundleManager\AssetBundleManager.cs:639
    at LoadVariants+<InitializeLevelAsync>c__Iterator2.MoveNext () [0x0003f] in C:\Users\Niall\Downloads\Unity-Technologies-assetbundledemo-0bb0dc961089\Unity-Technologies-assetbundledemo-0bb0dc961089\demo\Assets\AssetBundleSample\Scripts\LoadVariants.cs:139
    at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00028] in C:\buildslave\unity\build\Runtime\Export\Coroutines.cs:17
    UnityEngine.MonoBehaviour:StartCoroutine_Auto_Internal(IEnumerator)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) (at C:\buildslave\unity\build\artifacts\generated\common\runtime\MonoBehaviourBindings.gen.cs:54)
    <BeginExample>c__Iterator0:MoveNext() (at Assets\AssetBundleSample\Scripts\LoadVariants.cs:74)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at C:\buildslave\unity\build\Runtime\Export\Coroutines.cs:17)
    (Filename: Assets/AssetBundleManager/AssetBundleManager.cs Line: 372)
     
  3. jasonnk

    jasonnk

    Joined:
    Sep 30, 2016
    Posts:
    7
    Have you managed to get anywhere with this?

    I managed to fix the permissions issue by using netsh to allow the url to work
    netsh http add urlacl url=http://*:7888/ user=Everyone listen=yes

    this seems to work when running the local server from the commandline outside of unity.
    However, I can't get it to work by using the menu item inside unity to run the server process.