Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

GetLocalizedString() fails with StackOverflowException

Discussion in 'Localization Tools' started by nickfla1, Dec 28, 2020.

  1. nickfla1

    nickfla1

    Joined:
    Mar 30, 2014
    Posts:
    2
    Hello!
    The project was working correctly before restating my computer, after I reopened Unity I couldn't manage to make LocalizedStrings to work properly. I've checked my scriptable objects (where I keep LocalizedString's references) and they seem to be configured properly.

    upload_2020-12-28_0-55-0.png

    This is how I read and set the localized text. It's called by the Start function of the MonoBehaviour.
    I've also tried waiting for LocalizationSettings.InitializationOperation but without success.

    Code (CSharp):
    1. private IEnumerator SetTooltipText()
    2. {
    3.     var localizedString = interactableData.Tooltip.GetLocalizedString();
    4.     yield return localizedString;
    5.  
    6.     TooltipUi.text = localizedString.Result;
    7. }
    And this is the exception message:
    Couldn't extract exception string from exception of type StackOverflowException (another exception of class 'NullReferenceException' was thrown while processing the stack trace)

    Followed by a blank error message line.

    I'm using version 0.9.0-preview of the package and version 2020.2.0b14 of Unity.
    Thank you!
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,846
    Can you try updating to the latest version of Addressables? You can do it in the package manager.
     
  3. nickfla1

    nickfla1

    Joined:
    Mar 30, 2014
    Posts:
    2
    It worked! I didn't think about that! Thank you!
    Shall I mark the thread as solved?
     
    karl_jones likes this.
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,846
    Great :)
    You can mark it as solved, it's not something I pay much notice to. ;)