Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Issue with remote loading

Discussion in 'Localization Tools' started by danilonishimura, Oct 21, 2020.

  1. danilonishimura

    danilonishimura

    Joined:
    Jul 13, 2010
    Posts:
    71
    So, I've been using Addressables for a while, but just got started with the Localization Package.

    I've created a string localization table, and I want to build it and store it remotely in a CDN along with my other addressable assets, so I can update the text without building the game again.

    I've had success doing that with addressables, but not with the localization package. When I change the asset path to Build and Load paths, build the catalog, and change the Play Mode Script to "Use Existing Build", it fails to load the locales before the catalog gets loaded.



    It goes like this: On Awake it initializes the addressables, on initialization complete, loads the catalog. Exception happens after load catalog begins and before the catalog finishes loading. It doesn't even need localized assets in the scene for the error to come up.

    Code (CSharp):
    1. Exception encountered in operation UnityEngine.ResourceManagement.ResourceManager+CompletedOperation`1[System.Collections.Generic.IList`1[UnityEngine.Localization.Locale]], result='', status='Failed': Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=Locale, Type=UnityEngine.Localization.Locale
    2. UnityEditor.EditorApplication:Internal_PlayModeStateChanged(PlayModeStateChange)
    The tables are set to build and load remotely, but the Localization-Locales can't be changed. Which means I don't know if it's remote or local.
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,410
    You cant change the Localization-Locales addressable group settings?
    That sounds like the group has become corrupted.
    Try deleting the group asset from the Addressables directory and then click add all locales in the Localization settings editor to regenerate it. Does that fix it?

    Also you will need to make sure the the Shared group is also updated when you update the tables as this contains the SharedTable data.
     
    Last edited: Oct 21, 2020
  3. danilonishimura

    danilonishimura

    Joined:
    Jul 13, 2010
    Posts:
    71
    Hi Karl,
    You are right, the file got corrupted somehow. Deleting and regenerating it fixed not being able to modify the Localization-Locale settings, but the loading error, unfortunately, still happens.
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,410
    Is it the same error? Did you build the addressable assets after fixing the locales?
     
  5. danilonishimura

    danilonishimura

    Joined:
    Jul 13, 2010
    Posts:
    71
    Yes, it's the same error, and yes I've built it. I'm setting up a new empty project to try to replicate the error. I'll get back as soon as I get some results.
     
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,410
    Thanks. If it still happens can you please file a bug report?
    Also worth checking that the locales have the Locale label in addressables.
     
  7. danilonishimura

    danilonishimura

    Joined:
    Jul 13, 2010
    Posts:
    71
    So, it turns out I couldn't reproduce it on a new project. We triple checked everything in our project, saved closed and reopened Unity a few times to make sure all changes were saved, cleaned the build folder, and built it again. And it's working.

    So, what I think happened is that at some point, and I couldn't find out when it happened, some Localization addressables changed from remote build and load to Local build and load. As far as I can tell, that generates the error: having part of the localization assets as remote build/load and part as local build/load.

    I know I'm using a preview package, but while trying to figure out what was happening, it felt pretty random sometimes, and I'm pretty sure that at some point I had all localization set to remote, and still had the issue. Maybe it was working with some cached data, I don't know.

    On a side note: while those errors were popping, it would also randomly triggers some DOTS/Burst errors. Clicking on Dots\'Regenerate Burst Interop' fixes it for a while.
     
  8. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,410
    Thats strange. I suspect this is something in Addressables going wrong. Its worth making sure you have the latest version of Addressables installed. The package has an older version by default but will work with the latest.