Search Unity

Null Reference on LocalesProvider.ResetState()

Discussion in 'Localization Tools' started by L0tan, Dec 25, 2021.

  1. L0tan

    L0tan

    Joined:
    Jul 16, 2017
    Posts:
    75
    I'm trying the Localization package (1.0.5) on empty Unity project 2019.4 & 2020.3.

    On both of them I have only imported the Localization package, added two Locales (Spanish and English) and added English to Project Locale Identifier and as a Default LocaleSelector.

    When I press play on an empty scene, the following error message appears:

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEngine.Localization.Settings.LocalesProvider.ResetState () (at Library/PackageCache/com.unity.localization@1.0.5/Runtime/Settings/LocalesProvider.cs:139)
    3. UnityEngine.Localization.Settings.LocalizationSettings.ResetState () (at Library/PackageCache/com.unity.localization@1.0.5/Runtime/Settings/LocalizationSettings.cs:570)
    4. UnityEngine.Localization.Settings.LocalizationSettings.OnDisable () (at Library/PackageCache/com.unity.localization@1.0.5/Runtime/Settings/LocalizationSettings.cs:242)
    What am I doing wrong? I've followed the steps on this official guide.
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,291
    What version if 2019.4 and 2020.3 are you using? Is it the latest?
    Try updating to the latest version, there was a similar sounding bug that should be fixed by updating.
     
  3. L0tan

    L0tan

    Joined:
    Jul 16, 2017
    Posts:
    75
    Thanks for the reply @karl_jones ^^ I'm using 2019.4.13f1 and 2020.3.5f1, which version is bug-safe?
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,291
    Either one as long as it's the latest. Those 2 versions are old, especially the 2019.4 one. The latest of either 2019.4 or 2020.3 will have the fix.
     
  5. L0tan

    L0tan

    Joined:
    Jul 16, 2017
    Posts:
    75
    The 2019.4 one is old, but the 2020.3 is also old? which version is better? On the Unity Archive those are the upper ones:

    upload_2021-12-28_11-22-38.png
     
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,291
    They are both old. You have 2020.3.5 which is 20 releases behind. You will need the latest patch version from the hub for the version you plan to use, e.g 2030.3.25f1
    The issue was fixed and released in a patch a few months ago so will definitely be in the latest version
     
    L0tan likes this.
  7. L0tan

    L0tan

    Joined:
    Jul 16, 2017
    Posts:
    75
    Confirmed, seems to work properly on 2020.3.8f1
    I'll test which version of 2019 can work properly too
    Thanks!
     
    karl_jones likes this.