Search Unity

Incorrect Settings Path when Building Standalone Player using 1.6.2

Discussion in 'Addressables' started by Dig-Doug, Feb 21, 2020.

  1. Dig-Doug

    Dig-Doug

    Joined:
    Aug 30, 2019
    Posts:
    4
    Hi,

    I'm having some trouble getting the Addressables system to work in a standalone build. When I run in the editor, everything works correctly, even when using the different "Play Mode Script" options (e.g. "Simulate", "Use Existing..."). However, when I do a standalone player build, the player cannot load the assets, erroring with an InvalidKeyException.

    I connected a debugger to the player and I saw that in `InitializationOperation.cs` > `CreateInitializationOperation`, the `playerSettingsLocation` variable is set to: `file:///home/doug/Development/grid/build/grid/client/grid_client_linux/grid_client_linux_Data/../Library/com.unity.addressables/settings_BuildScriptFastMode.json`.

    This location looks wrong to me. `home/doug/Development/grid/build/grid/client/grid_client_linux` is where I saved the standalone player, but there's no Library directory there. However, there is another directory:

    `/home/doug/Development/grid/build/grid/client/grid_client_linux/grid_client_linux_Data/StreamingAssets/aa/Linux`

    With a `catalog.json` and other files that look like my assets.

    This makes me think that it's a config issue. I have only 1 profile using the default values:

    BuildTarget
    [UnityEditor.EditorUserBuildSettings.activeBuildTarget]
    LocalBuildPath
    [UnityEngine.AddressableAssets.Addressables.BuildPath]/[BuildTarget]
    LocalLoadPath
    {UnityEngine.AddressableAssets.Addressables.RuntimePath}/[BuildTarget]

    and am building the player with this code:

    Code (CSharp):
    1.         AddressableAssetSettings.CleanPlayerContent(AddressableAssetSettingsDefaultObject.Settings
    2.       .ActivePlayerDataBuilder);
    3.     AddressableAssetSettings.BuildPlayerContent();
    4.  
    5.     var report = BuildPipeline.BuildPlayer(new BuildPlayerOptions()
    6.     {
    7.       scenes = new[]
    8.       {
    9.         "Assets/Scenes/MainMenu.unity",
    10.         "Assets/Scenes/Game2.unity",
    11.       },
    12.       locationPathName = "../../../../../build/grid/client/grid_client_linux/grid_client_linux",
    13.       target = BuildTarget.StandaloneLinux64,
    14.       targetGroup = BuildTargetGroup.Standalone,
    15.       options = BuildOptions.Development | BuildOptions.AllowDebugging,
    16.     });
    Any idea why this might be happening?

    I'm using "com.unity.addressables": "1.6.2"

    Thanks!
     
  2. Dig-Doug

    Dig-Doug

    Joined:
    Aug 30, 2019
    Posts:
    4
    The problem seems to be that a AddressablesRuntimeDataPath value is being set in the local game config (On linux in ~/.config/unity3d/). When I delete that value, the player is able to find the assets properly.

    The config is read in AddressablesImpl.InitializeAsync