Search Unity

Bug Addressables causes build to fail

Discussion in 'Localization Tools' started by DePoGeer6, Jul 14, 2022.

  1. DePoGeer6

    DePoGeer6

    Joined:
    Sep 13, 2021
    Posts:
    20
    Before I begin, I want to say I've read through and tried the solutions for all the related threads and bug reports I've been able to find about this issue (like this one and this one), and yet haven't been able to find a solution, hence my posting another thread.

    While I'm not able to upload my log file, it contains many lovely errors including but not limited to:
    OperationException : Addressables - Unable to load runtime data at location UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1[[UnityEngine.AddressableAssets.Initialization.ResourceManagerRuntimeData, Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]].

    RuntimeData is null. Please ensure you have built the correct Player Content.

    No Locale could be selected:
    No Locales were available. Did you build the Addressables?

    OperationException : SelectedLocale is null. Could not load table.​

    Now, I've tried clearing and rebuilding my addressables, I've tried running the localization analyzers, I've confirmed the build and load paths of the addressables, etc, but no luck.
    (I'm using Unity 2020.3.28, Addressables 1.19.19, and Localization 1.3.2)

    I don't know if tagging is allowed here, but @karl_jones seems to be the man to call from the dozen other threads I've just read through in the past two hours.
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    What platform are you building for?
    Does it happen in the editor if you change the addressable play mode to use existing build?
     
  3. DePoGeer6

    DePoGeer6

    Joined:
    Sep 13, 2021
    Posts:
    20
    I was building for Windows, but something strange has happened. In the middle of trying to check what you just wrote, my computer spontaneously crashed on me and shut down. When everything powered back on again and I launched Unity, my localization stuff is still working as it was, but all the build errors have gone away. I've gone and checked all the addressables settings and nothing seems to have notably changed, but it looks like a random Windows 11 system crash seems to have magically fixed the problem?
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    Hmm that's weird. Had you done any editor restarts after the issue was found? Maybe the restart fixed it.
     
  5. DePoGeer6

    DePoGeer6

    Joined:
    Sep 13, 2021
    Posts:
    20
    Now that you say that, I don't think I had restarted the editor since it came up, but in these last 5 minutes I've discovered a new issue. Everything is building error free now, but somehow the build is not using the most up to date localization tables. For example, if I go and switch a value in the localization table from "New Game" to "Blahdy Blah", in the editor the button now displays "Blahdy Blah", but when I Build and Run, it's still using "New Game"
     
  6. DePoGeer6

    DePoGeer6

    Joined:
    Sep 13, 2021
    Posts:
    20
    To fix that, I've gone back and cleared and rebuilt the addressables, and now the localization tables are updating again...but we're right back to the exact same string of errors I had at the start of this thread. To answer your previous question, no the errors do not show up in the editor even if I change the addressable play mode to use existing build
     
  7. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    Does it happen in the editor if you change the addressable play mode to use existing build?
    Running in the editor will read the assets directly but playmode will use the asset bundles when in use existing build mode, this is why it's different when you make a change.
     
  8. DePoGeer6

    DePoGeer6

    Joined:
    Sep 13, 2021
    Posts:
    20
    Nope, no errors regardless in the editor
     
  9. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    When you run the player build on windows how long is the file path? There are issues with very long file paths. Try running it from a small path such as the root drive. E.g C:\
     
  10. DePoGeer6

    DePoGeer6

    Joined:
    Sep 13, 2021
    Posts:
    20
    It was initially running from C:\Users\[User]\Downloads\Build, but I just ran it from C:\Build and no difference
     
  11. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    Yeah that path should be fine.
    What does the first error in the log file say?
    Does you build contain a directory called StreamingAssets with the localization asset bundles in it?
     
  12. DePoGeer6

    DePoGeer6

    Joined:
    Sep 13, 2021
    Posts:
    20
    First error to show up is:
    OperationException : Addressables - Unable to load runtime data at location UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1[[UnityEngine.AddressableAssets.Initialization.ResourceManagerRuntimeData, Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]].​

    Where would I see the StreamingAssets directory? Currently the build generates the .exe file, a MonoBleedingEdge folder, a Data folder, the Unity crash handler and the two .dll files
     
  13. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    On windows it should be in the Data folder.
     
  14. DePoGeer6

    DePoGeer6

    Joined:
    Sep 13, 2021
    Posts:
    20
    The data folder only has 'Managed' and 'Resources' directories (plus loose files), neither of which contain any subdirectories.
     
  15. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    That's strange. It should be setup when you do a build. Do you have some custom build chain running?
    Can you see the addressable folder in the project Library folder?
     
  16. DePoGeer6

    DePoGeer6

    Joined:
    Sep 13, 2021
    Posts:
    20
    No custom build chain--I'm not smart enough for that.

    The Library folder does have a 'com.unity.addressables' folder, and inside it does have an 'aa' folder filled with files, which if I understand correctly is what's meant to be copied to the nonexistent StramingAssets folder in the build
     
    Last edited: Jul 14, 2022
  17. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    Can you create a folder called StreamingAssets in the data folder and copy the AA directory into it?
    See if it works after that.
     
  18. DePoGeer6

    DePoGeer6

    Joined:
    Sep 13, 2021
    Posts:
    20
    Copy the AA so that it's Data/StreamingAssets/AA/Windows or copy the contents of AA/Windows
     
  19. DePoGeer6

    DePoGeer6

    Joined:
    Sep 13, 2021
    Posts:
    20
    Doesn't matter I tried both and neither changed a thing
     
  20. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    It should be in the Data folder like so
    upload_2022-7-14_22-25-45.png

    The aa file goes inside.
    Inside aa there should be 2 json files, a catalog and a settings one.

    Has the error message changed since you moved the folder into the build?
    This appears to be an addressables issue but im not sure whats going wrong. It's hard to diagnose without seeing the log. Do you get any errors during the build?
     
  21. DePoGeer6

    DePoGeer6

    Joined:
    Sep 13, 2021
    Posts:
    20
    By saving the log as a .txt I can upload it and share it with you
     

    Attached Files:

    karl_jones likes this.
  22. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
  23. DePoGeer6

    DePoGeer6

    Joined:
    Sep 13, 2021
    Posts:
    20
    No...I copied the aa folder exactly from the Library folder, so it's:
    'C:/Users/depog/Downloads/Test/SpritesheetTest_Data/StreamingAssets/aa/Windows/settings.json'.

    Moving things out of that Windows directory worked, but how come the StreamingAssets folder didn't get created automatically? Should I be good moving forward?
     
  24. DePoGeer6

    DePoGeer6

    Joined:
    Sep 13, 2021
    Posts:
    20
    Aha so it doesn't solve the problem moving forward. Whilst this build might work now that I've manually configured the files, I went ahead and changed one string in the localization tables, built the project again, and back to the errors
     
  25. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    It should be created automatically during the building process, then it gets copied over. Something is going wrong. I'll speak to the addressables team and see if they have any ideas. For now you are fine to do this. You will just need to remember to copy the files over after the build.
     
  26. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    You will need to rebuild the addressables when you make a change. Then copy the folder over again
     
  27. DePoGeer6

    DePoGeer6

    Joined:
    Sep 13, 2021
    Posts:
    20
    Got it--but that's a temporary fix, not the intended workflow, right?
     
    karl_jones likes this.
  28. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    Yes but the end result is the same. It's just a pain for you to have to copy the folder each time. When you build the game it should automatically do the copying for you in the background. Something seems to have broken this for you.
     
    Last edited: Jul 18, 2022
  29. DePoGeer6

    DePoGeer6

    Joined:
    Sep 13, 2021
    Posts:
    20
    Update: Suddenly (I can't tell you exactly what I changed to make this happen since it was after a full day of development on the project), as long as I manually clean and rebuild the addressables each time, when I make a build the StreamingAssets folder actually gets automatically created as it should. If I don't manually rebuild the addressables, the problem remains where no folders are getting created and I have to manually copy them over from the Library folder.

    I'm guessing that ideally I shouldn't have to be manually doing either, but this is certainly better than no solution
     
  30. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    The manual rebuild is something you have to do although you shouldn't need to do it each time, only when you make changes to localization. It should also be possible to set addressables to build automatically on newer versions of Unity(2021.2+) there's an option in the addressable settings. https://docs.unity3d.com/Packages/c....19/manual/Configuration.html#system-settings