Search Unity

Warnings on iOS

Discussion in 'Localization Tools' started by PacoLabs, May 11, 2020.

  1. PacoLabs

    PacoLabs

    Joined:
    Jun 29, 2017
    Posts:
    31
    Hi,
    When running my app on iOS with Localization 0.6.1, I get those 2 messages displayed in the console :

    Initialize engine version: 2019.3.13f1 (d4ddf0d95db9)
    A scripted object (probably UnityEngine.Localization.Settings.LocalizationSettings?) has a different serialization layout when loading. (Read 412 bytes but expected 2584 bytes)
    Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
    (Filename: Line: 2269)

    UnloadTime: 6.976417 ms
    Could not find localization settings. Default will be used.
    UnityEngine.Localization.Settings.LocalizationSettings:GetOrCreateSettings()
    UnityEngine.Localization.Settings.LocalizationSettings:get_Instance()
    UnityEngine.Localization.Settings.LocalizationSettings:get_InitializationOperation()


    Is there something I can(must) change to fix that ?

    Also, I'm wondering if you know how safe it is to use this preview package in a released app.
    I use only the feature of localising strings, and everything seems to work correctly, so I hope it is quite safe, but would you say it is still too soon to use it ?
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,279
    Hi,
    Could you please file a bug report for that warning? It sounds like it's preventing the Localisation settings from loading so if you made any custom changes they would be lost.

    If the package is working for you then that's great but just be aware it's in preview so things can change and it's still going through development. We are scheduled to come out of preview early next year so depending on your timeline it may be fine.
     
  3. PacoLabs

    PacoLabs

    Joined:
    Jun 29, 2017
    Posts:
    31
    Thank you.
    Here it is Case 1246391 :)

    For information, I could not reproduce a problem on a clean new project.
    So I stripped down my project, and this is the attached project (that 100% reproduces the problem).


    Note that according to the message, It seems to me that the problem is from the property in the LocalizationSettingsEditorOnly file.
    If you've got a workaround or a fix I can apply, I'm in !
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,279
    Yeah, we have editor only data inside of LocalizationSettingsEditorOnly, that will be the problem.
    If you have not changed anything in the LocalizationSettings(mainly SmartFormat stuff) then you should be fine with the defaults now. We will likely need to move some of the editor settings out of LocalizationSettings. I'm afraid there's no simple workaround although hopefully, we can get a proper fix once the bug report has been processed.
    Thanks for the feedback so far.
     
  5. PacoLabs

    PacoLabs

    Joined:
    Jun 29, 2017
    Posts:
    31
    Thanks,
    Yes, I think the defaults are OK for me (I can avoid using the SmartFormat).
    Fortunately, it seems that even some added locales/tables are loaded anyway.
     
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,279
    Yes locales and tables are independent from the Localisation settings so you should be fine.
     
    PacoLabs likes this.
  7. bottledgalaxy

    bottledgalaxy

    Joined:
    Jul 19, 2019
    Posts:
    84
    I got this error when building for Android instead
     
  8. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,279
    Do you have stripping enabled? It will happen on any platform with stripping level set to medium or high. It's a known bug we are working on.
     
  9. bottledgalaxy

    bottledgalaxy

    Joined:
    Jul 19, 2019
    Posts:
    84
    Yup! Stripping High. Thanks for clearing that up!
     
  10. samanabo

    samanabo

    Joined:
    Mar 10, 2015
    Posts:
    51
    I've also hit this issue on macOS standalone, with managed stripping set to high (or medium).

    Is there a bug report we can follow?

    I was able to work around this issue by adding an entry into unity's linker (added a link.xml file to the assets directory):
    Code (CSharp):
    1. <assembly fullname="Unity.Localization" preserve="all">
    2.         <type fullname="UnityEngine.Localization" preserve="all" />
    3. </assembly>
     
  11. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,279
  12. samanabo

    samanabo

    Joined:
    Mar 10, 2015
    Posts:
    51
    Thanks @karl_jones.

    It seems the linker fix I posted previously does not work around the problem, I suspect the stripping level in my project was just set to low when I was testing.

    Can you confirm the
    startup locale selectors
    would only use the default settings because of this bug?
    And if so, what is the default order/setup for the startup locale selector?

    Also any update on a fix for this? I can see the linked issue above is resolved for Unity 2020, but maybe not for 2019?
    Do we have a link for the bug report specifically for the localization package?

    Thanks again!
     
  13. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,279
    This is the bug for the localization package https://issuetracker.unity3d.com/product/unity/issues/guid/LOC-98
    If you do Create/Localization/Localization Settings it will create a default asset which you can then check to see what the defaults will be.

    I saw some changes being made to the link.xml file to Addressables recently so this may help although the last time I spoke to the devs there were 2 issues that were causing this so ill have to check if the other one is fixed yet.