Search Unity

Question Addressables build issue

Discussion in 'Addressables' started by Airman, Jun 8, 2023.

  1. Airman

    Airman

    Joined:
    Apr 13, 2014
    Posts:
    2
    Hi there,

    I'm currently developing a multiplayer game and I'm using addressables in my project. Today I've run into an issue which I can't seem to shake, which is the following:


    Cannot read BuildLayout header, BuildLayout has not open for a file
    UnityEditor.AddressableAssets.Settings.AddressableAssetSettings:BuildPlayerContent (UnityEditor.AddressableAssets.Build.AddressablesPlayerBuildResult&)
    AddressablesPlayerBuildProcessor:PrepareForPlayerbuild (UnityEditor.AddressableAssets.Settings.AddressableAssetSettings,UnityEditor.Build.BuildPlayerContext,bool) (at ./Library/PackageCache/com.unity.addressables@1.21.12/Editor/Build/AddressablesPlayerBuildProcessor.cs:101)
    AddressablesPlayerBuildProcessor:PrepareForBuild (UnityEditor.Build.BuildPlayerContext) (at ./Library/PackageCache/com.unity.addressables@1.21.12/Editor/Build/AddressablesPlayerBuildProcessor.cs:80)
    UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()


    This stops me from being able to build my project. What I've tried:
    - Clearing the cache
    - Deleting the addressablesAssetData folder
    - Doing a new addressables build

    None of these steps have worked. As this is a multiplayer game, the only way I can really test it is by creating builds so this has stopped me in my tracks a fair bit. Any help would be greatly appreciated.

    I'm using Unity v2022.3.0 and using addressables v1.21.12.
     
  2. Airman

    Airman

    Joined:
    Apr 13, 2014
    Posts:
    2
    This may have been some weird data in a previous build that was still interfering with current builds. I tried a clean build from the build menu in Unity and it is seemingly back to normal.
     
    amenonegames likes this.
  3. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    I have the same issue. Can you explain what you mean by a clean build from the unity menu.
     
  4. amenonegames

    amenonegames

    Joined:
    Nov 10, 2021
    Posts:
    19
    Thank you very much!!
    I annoyed same matter, and solved clean build!!

    @radiantboy

    maybe clean build in build menu.
    Please click small triangle next to Build button in Build Settings window.
     
    gareth_withVR and radiantboy like this.
  5. Nar1nda

    Nar1nda

    Joined:
    Apr 3, 2022
    Posts:
    3
    I have a clean build and still have this error. Any other suggestions?

    Code (CSharp):
    1. Cannot read BuildLayout header, BuildLayout has not open for a file
    2. UnityEditor.AddressableAssets.Settings.AddressableAssetSettings:BuildPlayerContent (UnityEditor.AddressableAssets.Build.AddressablesPlayerBuildResult&)
    3. AddressablesPlayerBuildProcessor:PrepareForPlayerbuild (UnityEditor.AddressableAssets.Settings.AddressableAssetSettings,UnityEditor.Build.BuildPlayerContext,bool) (at ./Library/PackageCache/com.unity.addressables@1.21.12/Editor/Build/AddressablesPlayerBuildProcessor.cs:101)
    4. AddressablesPlayerBuildProcessor:PrepareForBuild (UnityEditor.Build.BuildPlayerContext) (at ./Library/PackageCache/com.unity.addressables@1.21.12/Editor/Build/AddressablesPlayerBuildProcessor.cs:80)
    5. UnityEditor.BuildPlayerWindow/DefaultBuildMethods:BuildPlayer (UnityEditor.BuildPlayerOptions)
    6. Naninovel.BuildProcessor:BuildPlayer (UnityEditor.BuildPlayerOptions) (at Assets/Naninovel/Editor/Build/BuildProcessor.cs:46)
    7. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
    8.  
     
  6. Jon-Gao

    Jon-Gao

    Joined:
    Dec 9, 2012
    Posts:
    17
    I'm following the solution from this article and it work for me: https://marumaro7.hatenablog.com/entry/CannotreadBuildLayoutheader
    Which is delete file "AddressablesConfig.dat" from Library folder, then restart Editor.
     
  7. Hypnotoad0

    Hypnotoad0

    Joined:
    Jun 22, 2013
    Posts:
    47
    I just fixed this by closing the 'Addressables report' window, looks like it being open is causing this to happen.
     
    eechungiap likes this.
  8. eechungiap

    eechungiap

    Joined:
    Sep 9, 2018
    Posts:
    4
    Thank you, this fixed the issue quickly. I've been fixing it in a more tedious way which i found out by luck, it goes by running analyze selected rule, change the script a little for it to recompile, then build it. with no other action in between. The non-sensical sequence was quite worrying.
     
    Last edited: Apr 8, 2024