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. Dismiss Notice

Localization Fallback Problem

Discussion in 'Editor & General Support' started by whitedrow, Feb 13, 2021.

  1. whitedrow

    whitedrow

    Joined:
    Mar 31, 2008
    Posts:
    15
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,846
    Kurt-Dekker likes this.
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,766
    This looks like a bog standard null reference. You gotta figure out what this refers to in the localization package:

    ArgumentNullException: Value cannot be null. Parameter name: _unity_self


    Since it's saying "ArgumentNullException" that might be something like an animator or animation state or something that Unity is expecting to be set up but isn't set up on device.

    That package might have conditionally-compiled code for use outside the editor, so it might just be best to look for
    _unity_self
    and see if you can get any intel on what might be null or need setting up.

    Here's my standard blurb on nullrefs. There's really no other way around them:

    The answer is always the same... ALWAYS. It is the single most common error ever. Don't waste your life on this problem. Instead, learn how to fix it fast... it's EASY!!

    Some notes on how to fix a NullReferenceException error in Unity3D
    - also known as: Unassigned Reference Exception
    - also known as: Missing Reference Exception
    - also known as: Object reference not set to an instance of an object

    http://plbm.com/?p=221

    The basic steps outlined above are:
    - Identify what is null
    - Identify why it is null
    - Fix that.

    Expect to see this error a LOT. It's easily the most common thing to do when working. Learn how to fix it rapidly. It's easy. See the above link for more tips.

    This is the kind of mindset and thinking process you need to bring to this problem:

    https://forum.unity.com/threads/why-do-my-music-ignore-the-sliders.993849/#post-6453695

    Step by step, break it down, find the problem.
     
  4. whitedrow

    whitedrow

    Joined:
    Mar 31, 2008
    Posts:
    15
    No it seems to work, because of starting build/new build/default build script
    Seems that the documentation needs an update because there its called Select Build->Build Player Content :)

    Thank you very much Karl for your help!

    (And thank you too Kurt - your right, ALWAYS. The bug has gone too)
     

    Attached Files:

    Kurt-Dekker likes this.
  5. whitedrow

    whitedrow

    Joined:
    Mar 31, 2008
    Posts:
    15
    Hi,
    I tried to reproduce the error
    Code (CSharp):
    1. ArgumentNullException: Value cannot be null. Parameter name: _unity_self
    It seemed to happen, if i remove and add locales - but not always.

    So what is the best way to remove Locales from the table? For example ar, bg an ca:
     

    Attached Files:

  6. whitedrow

    whitedrow

    Joined:
    Mar 31, 2008
    Posts:
    15
    And one last question:
    I'm able to get the Locales Name with
    Code (CSharp):
    1. LocalizationSettings.SelectedLocale
    Ist there a way to get the country code (for example en or de)?
     

    Attached Files:

  7. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,846
    The code is stored in the Locale identifier property.

    To remove a language you should either go to the table collection asset and click remove to just remove it from the build but keep the asset, or delete the table with the name table_code.
     
  8. marcozakaria

    marcozakaria

    Joined:
    Sep 17, 2017
    Posts:
    22
    This error still happens with me even after building addressables multiple times
    unity 2021.3.7f
    package version 1.3.2
    upload_2023-2-16_15-59-8.png
     
  9. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,846
    Hi,
    Could you try updating to the latest version of the package, 1.4.3?
    If its not visible in the package manager you may need to enable the show all versions option in the preferences or edit the manifest.json file in the project Packages folder. If the issue is still happening then please file a bug report so we can investigate https://unity3d.com/unity/qa/bug-reporting
     
    marcozakaria likes this.
  10. marcozakaria

    marcozakaria

    Joined:
    Sep 17, 2017
    Posts:
    22
    The error still happening after updating to 1.4.3 and building addressable after it
     
  11. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,846
    Could you please file a bug report https://unity3d.com/unity/qa/bug-reporting
    This error is unlikely to have anything to do with Addressables.
     
    Last edited: Feb 16, 2023
    marcozakaria likes this.
  12. marcozakaria

    marcozakaria

    Joined:
    Sep 17, 2017
    Posts:
    22
    upload_2023-2-17_0-5-55.png

    Thanks i uploaded a bug report this error happens when i try to add string reference to LocalizeStringEvent
     
    karl_jones likes this.