Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Error with Play Mode with Domain and Scene reload disabled

Discussion in 'Localization Tools' started by ranaUK, May 13, 2021.

  1. ranaUK

    ranaUK

    Joined:
    Mar 1, 2017
    Posts:
    166
    Using the latest Version 1.0.0-pre.9 - May 12, 2021

    Followed the tutorial, and created just string asset; without "Enter Play mode Options", everything is fine. With "Play mode" selected, and "Domain and Scene reload disabled", I am getting errors which were supposed to be fixed in 0.11

    Code (CSharp):
    1. No Locale could be selected:
    2. The following (2) Locales were considered:
    3.     Russian (ru)
    4.     English (en)
    5. The following (3) IStartupLocaleSelectors were used:
    6.     UnityEngine.Localization.Settings.SpecificLocaleSelector
    7.     UnityEngine.Localization.Settings.CommandLineLocaleSelector
    8.     UnityEngine.Localization.Settings.SystemLocaleSelector
    9.  
    10. UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1/<>c__DisplayClass58_0<System.Collections.Generic.IList`1<UnityEngine.Localization.Locale>>:<add_CompletedTypeless>b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<System.Collections.Generic.IList`1<UnityEngine.Localization.Locale>>)
    11. DelegateList`1<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<System.Collections.Generic.IList`1<UnityEngine.Localization.Locale>>>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<System.Collections.Generic.IList`1<UnityEngine.Localization.Locale>>) (at Library/PackageCache/com.unity.addressables@1.18.2/Runtime/ResourceManager/Util/DelegateList.cs:69)
    12. UnityEngine.ResourceManagement.ChainOperationTypelessDepedency`1<System.Collections.Generic.IList`1<UnityEngine.Localization.Locale>>:OnWrappedCompleted (UnityEngine.R

    Followed by: OperationException : SelectedLocale is null

    and

    NullReferenceException: Object reference not set to an instance of an object
    UnityEngine.Localization.LoadTableOperation`2[TTable,TEntry].RegisterTableOperation (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1[TObject] handle) (at

    any ideas?

    as a workaround, I tried to implement the following:

    Code (CSharp):
    1. namespace UnityEngine.Localization.Samples
    2. {
    3.     [CreateAssetMenu(menuName = "Localization/Examples/Custom Locale Provider")]
    4.     public class CustomLocalesProvider : LocalesProvider
    5.     {
    6.         [SerializeField] List<Locale> m_Locales = new List<Locale>();
    7.  
    8.         public override List<Locale> Locales
    9.         {
    10.             get { return m_Locales; }
    11.             set { m_Locales = value; }
    12.         }
    13.     }
    14. }
    Didn't work; Locales is not marked as virtual; and even if I change it to new, I don't get the menu item.



    PS: changelog at
    https://docs.unity3d.com/Packages/com.unity.localization@0.11/changelog/CHANGELOG.html
    still shows old log; is there an updated url;
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,226
    That's unusual. It's found the locales English and Russian so the Locales provider is not the problem unless you have more than 2 Locales in the project and its not finding them all. However it doesn't know which one to use. Have you configured the Startup Selectors? Can you show how they are configured?

    The changelog is now correct, updating the docs is a manual process that the docs team have to do so it takes a bit of time for the site to update.
     
    Last edited: May 13, 2021
  3. ranaUK

    ranaUK

    Joined:
    Mar 1, 2017
    Posts:
    166
    Hi Karl, thanks for your reply. I had to remove localisation from my project; I couldn't live with the slow start with "domain reload" enabled, and I couldn't find any easy way to disable it from project. Removing the asset from settings would still raise error.

    I can obviously put it back and take some screenshot if that would help. I went with the basic setup; first was command; followed by system, and then finally specifying EN. I even tried moving my manual specification above the other two to see if that would solve it. Unfortunately it didn't.
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,226
    Are you able to share a project that has this problem? I am unable to reproduce it.
    I created a new project, added the settings and 2 Locales English(en) and Russian (ru). Enabled Enter Play Mode without domain and scene reload and pressed play. Everything worked fine. I suspect theres some setting, particular Unity version or something else that Im missing. A project with the issue would make it a lot easier to fix :)
    You can submit it through the bug reporter tool and post the bug id so I can grab it.