Search Unity

How to build via command line build?

Discussion in 'Addressables' started by dgoyette, Jan 11, 2019.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    1,270
    I'm still just verifying whether something weird happened, but it seems that for a command line build to work properly with addressables, I need to first do a normal build from within the Unity editor. If I don't do that first, I get exceptions at runtime while trying to load addressables.

    Is there some step I should add to my build process to build addressables first? I'm current building via this:

    Code (CSharp):
    1. BuildPipeline.BuildPlayer(scenes, fullExePath, BuildTarget.StandaloneWindows64, BuildOptions.Development | BuildOptions.AllowDebugging);
     
  2. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    320
    Make another step before that with
    Code (CSharp):
    1. AddressableAssetSettings.BuildPlayerContent().
    In case you build remote bundles you will need an additional step to upload those to your remote loaction.
     
    arima_moto, unity_bill and dgoyette like this.
  3. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    1,270
    Thanks a bunch. I looked all through the 'Addressables' class looking for something like this, but never knew about AddressableAssetSettings. Very helpful.
     
    MNNoxMortem likes this.
  4. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    1,270
    I've only just had a chance to try this out. I added BuildPlayerContent to my build script, but on starting the built game, I always get the following error:

    Invalid path in RawDataProvider: 'C:/Users/Dan/AppData/LocalLow/Gravia Software, LLC/Gravia/com.unity.addressables/catalog_2019.01.18.03.44.25.hash'.

    Here's the full error:

    Exception encounterd in operation UnityEngine.ResourceManagement.RawDataProvider+InternalOp`1[System.Object], result='', status='None', valid=True, location=LocalCatalogHash65e2afbf830dd4a459486edd20c892a3..
    UnityEngine.DebugLogHandler:Internal_Log()
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Logger:LogFormat(LogType, String, Object[])
    UnityEngine.Debug:LogErrorFormat(String, Object[])
    UnityEngine.AddressableAssets.Addressables:LogException(IAsyncOperation, Exception) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.addressables@0.5.3-preview\Runtime\Addressables.cs:177)
    UnityEngine.ResourceManagement.AsyncOperationBase`1:set_OperationException(Exception) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\AsyncOperations\AsyncOperationBase.cs:167)
    UnityEngine.ResourceManagement.InternalOp`1:<.ctor>b__4_0(IAsyncOperation`1) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\ResourceProviders\RawDataProvider.cs:43)
    UnityEngine.ResourceManagement.InternalOp`1:Start(IResourceLocation, IAsyncOperation`1, Func`2) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\ResourceProviders\RawDataProvider.cs:82)
    UnityEngine.ResourceManagement.RawDataProvider:provide(IResourceLocation, IAsyncOperation`1) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\ResourceProviders\RawDataProvider.cs:133)
    UnityEngine.ResourceManagement.ResourceManager:provideResource(IResourceLocation) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\ResourceManager.cs:94)
    UnityEngine.ResourceManagement.GroupOperation`1:Start(IList`1, Action`1, Func`2) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\AsyncOperations\AsyncOperationBase.cs:474)
    UnityEngine.ResourceManagement.ResourceManager:provideResources(IList`1, Action`1) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\ResourceManager.cs:109)
    UnityEngine.ResourceManagement.ResourceManager:LoadDependencies(IResourceLocation) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\ResourceManager.cs:252)
    UnityEngine.ResourceManagement.ResourceManager:provideResource(IResourceLocation) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\ResourceManager.cs:94)
    UnityEngine.AddressableAssets.InitializationOperation:LoadContentCatalog(IList`1, Int32) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.addressables@0.5.3-preview\Runtime\InitializationOperation.cs:100)
    UnityEngine.AddressableAssets.InitializationOperation:OnDataLoaded(IAsyncOperation`1) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.addressables@0.5.3-preview\Runtime\InitializationOperation.cs:93)
    System.Reflection.MonoMethod:InternalInvoke()
    System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
    System.Reflection.MethodBase:Invoke(Object, Object[])
    System.Delegate:DynamicInvokeImpl(Object[])
    System.MulticastDelegate:DynamicInvokeImpl(Object[])
    System.Delegate:DynamicInvoke(Object[])
    UnityEngine.ResourceManagement.DelegateInfo:Invoke() (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\Util\DelayedActionManager.cs:48)
    UnityEngine.ResourceManagement.DelayedActionManager:LateUpdate() (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\Util\DelayedActionManager.cs:198)

    (Filename: C:/Users/Dan/Documents/GitHub/Gravia/Library/PackageCache/com.unity.addressables@0.5.3-preview/Runtime/Addressables.cs Line: 177)

    Exception: Invalid path in RawDataProvider: 'C:/Users/Dan/AppData/LocalLow/Gravia Software, LLC/Gravia/com.unity.addressables/catalog_2019.01.18.03.44.25.hash'.

    UnityEngine.DebugLogHandler:Internal_LogException()
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    UnityEngine.Logger:LogException(Exception, Object)
    UnityEngine.Debug:LogException(Exception)
    UnityEngine.AddressableAssets.Addressables:LogException(IAsyncOperation, Exception) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.addressables@0.5.3-preview\Runtime\Addressables.cs:178)
    UnityEngine.ResourceManagement.AsyncOperationBase`1:set_OperationException(Exception) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\AsyncOperations\AsyncOperationBase.cs:167)
    UnityEngine.ResourceManagement.InternalOp`1:<.ctor>b__4_0(IAsyncOperation`1) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\ResourceProviders\RawDataProvider.cs:43)
    UnityEngine.ResourceManagement.InternalOp`1:Start(IResourceLocation, IAsyncOperation`1, Func`2) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\ResourceProviders\RawDataProvider.cs:82)
    UnityEngine.ResourceManagement.RawDataProvider:provide(IResourceLocation, IAsyncOperation`1) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\ResourceProviders\RawDataProvider.cs:133)
    UnityEngine.ResourceManagement.ResourceManager:provideResource(IResourceLocation) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\ResourceManager.cs:94)
    UnityEngine.ResourceManagement.GroupOperation`1:Start(IList`1, Action`1, Func`2) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\AsyncOperations\AsyncOperationBase.cs:474)
    UnityEngine.ResourceManagement.ResourceManager:provideResources(IList`1, Action`1) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\ResourceManager.cs:109)
    UnityEngine.ResourceManagement.ResourceManager:LoadDependencies(IResourceLocation) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\ResourceManager.cs:252)
    UnityEngine.ResourceManagement.ResourceManager:provideResource(IResourceLocation) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\ResourceManager.cs:94)
    UnityEngine.AddressableAssets.InitializationOperation:LoadContentCatalog(IList`1, Int32) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.addressables@0.5.3-preview\Runtime\InitializationOperation.cs:100)
    UnityEngine.AddressableAssets.InitializationOperation:OnDataLoaded(IAsyncOperation`1) (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.addressables@0.5.3-preview\Runtime\InitializationOperation.cs:93)
    System.Reflection.MonoMethod:InternalInvoke()
    System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
    System.Reflection.MethodBase:Invoke(Object, Object[])
    System.Delegate:DynamicInvokeImpl(Object[])
    System.MulticastDelegate:DynamicInvokeImpl(Object[])
    System.Delegate:DynamicInvoke(Object[])
    UnityEngine.ResourceManagement.DelegateInfo:Invoke() (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\Util\DelayedActionManager.cs:48)
    UnityEngine.ResourceManagement.DelayedActionManager:LateUpdate() (at C:\Users\Dan\Documents\GitHub\Gravia\Library\PackageCache\com.unity.resourcemanager@2.4.4-preview\Runtime\Util\DelayedActionManager.cs:198)

    (Filename: Line: -1)

    I'm not really sure what to make of it. It's complaining about a file that exists (catalog_2019.01.18.03.44.25.hash). I tried deleting everything in the 'com.unity.addressables' directory. (All the _catalog files.) I then ran my game again, and it crashed the same way, and generated a new _catalog and .hash file. But then immediately reopening the game worked without crashing.

    So, I don't know what it's doing with those _catalog files, but it seems like the game creates a new _catalog file the first time it is run after a new build. And it will crash on the time it creates the file. But then subsequent runs of the game work fine.
     
    MNNoxMortem likes this.
  5. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    320
    @dgoyette That is a cache bug of the system and should not happen on further runs as you have noticed (and will likely be fixed rather sooner than later).
     
  6. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    1,270
    Meaning that it's a known issue they're working on? Or do you think I should report it?
     
  7. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    320
    @dgoyette, I am very sure it is known and like 70% sure bill even answerd to it somewhere. However, please report it anyhow as Unity puts a lot more focus on issues reported by many different users.
     
    dgoyette likes this.
  8. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    362
    I definitely agree with "find a bug -> report a bug". Unless you can find the exact bug on our public portal, or on the forums (with a case number). Even then, no harm in reporting a duplicate. Especially as sometimes the dupe contains more info or a better repro project.
     
    dgoyette and MNNoxMortem like this.
  9. bagelbaker

    bagelbaker

    Joined:
    Jun 5, 2017
    Posts:
    9
    I'm trying addressables and just stumbled on this same issue. The first time I played my build I got the exact errors as above and they didn't show up on subsequent builds. Our project is too big to send a bug report.

    I'm using 0.5.3-preview.
     
  10. bagelbaker

    bagelbaker

    Joined:
    Jun 5, 2017
    Posts:
    9