Language change not saving when restarting the game in Android Build

Hello,
I am using latest version of Localization Package. There is a problem in saving language change in Android Build. When I restarting game, language resetting to English. I tried Localization in my previous game (That time using Localization v7 maybe) and this problem was not there. As you said last time:

“Click the + button for the locale selectors. I think there’s one called player Prefs selector. Drag that to the top.”

So I done same. Everything working as expected in Unity Editor but in Android not.
Here is some logcat errors and warnings:

2021/01/13 21:32:02.599 17579 17597 Error Unity A scripted object (probably UnityEngine.Localization.Settings.LocalizationSettings?) has a different serialization layout when loading. (Read 184 bytes but expected 2724 bytes)

2021/01/13 21:32:02.599 17579 17597 Error Unity Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?



2021/01/13 21:32:09.355 17579 17597 Error Unity Exception: There is no active LocalizationSettings.
2021/01/13 21:32:09.355 17579 17597 Error Unity   at UnityEngine.Localization.Settings.LocalizationSettings.ValidateSettingsExist (System.String error) [0x00000] in <00000000000000000000000000000000>:0
2021/01/13 21:32:09.355 17579 17597 Error Unity   at UnityEngine.Localization.LocalizedString.add_StringChanged (UnityEngine.Localization.LocalizedString+ChangeHandler value) [0x00000] in <00000000000000000000000000000000>:0
2021/01/13 21:32:09.355 17579 17597 Error Unity (Filename: currently not available on il2cpp Line: -1)


2021/01/13 21:34:10.494 17579 17597 Warn Unity Could not find localization settings. Default will be used.
2021/01/13 21:34:10.494 17579 17597 Warn Unity UnityEngine.Localization.Settings.LocalizationSettings:GetOrCreateSettings()
2021/01/13 21:34:10.494 17579 17597 Warn Unity UnityEngine.Localization.Settings.LocalizationSettings:get_Instance()
2021/01/13 21:34:10.494 17579 17597 Warn Unity UnityEngine.Localization.Settings.LocalizationSettings:remove_SelectedLocaleChanged(Action`1)
2021/01/13 21:34:10.494 17579 17597 Warn Unity UnityEngine.Localization.LocalizedString:remove_StringChanged(ChangeHandler)
2021/01/13 21:34:10.494 17579 17597 Warn Unity MoreMountains.InfiniteRunnerEngine.MainMenuManager:OnClickQuit()
2021/01/13 21:34:10.494 17579 17597 Warn Unity UnityEngine.Events.UnityAction:Invoke()
2021/01/13 21:34:10.494 17579 17597 Warn Unity UnityEngine.Events.UnityEvent:Invoke()
2021/01/13 21:34:10.494 17579 17597 Warn Unity
2021/01/13 21:34:10.494 17579 17597 Warn Unity (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
2021/01/13 21:34:10.494 17579 17597 Warn Unity

Could not find localization settings. Default will be used.

This means that the settings file could not be found so any configuration you do will be lost.
Are you using stripping? There is a bug in Unity with SerializeReference and Addressables that causes it to fail if stripping is enabled. Try disabling stripping.

1 Like

OK, Thank you so much. Previously Managed Stripping Level was set to high, I changed it to low and now Problem is fixed in Android build.

1 Like