No Locale could be selected: The following (2) Locales were considered...

I’m a bit lost, probably I did something which caused this. Here’s what I experience.

Entire exception from the Console.

No Locale could be selected:
The following (2) Locales were considered:
    English (en)
    Hungarian (hu)
The following (3) IStartupLocaleSelectors were used:
    UnityEngine.Localization.Settings.SpecificLocaleSelector
    UnityEngine.Localization.Settings.CommandLineLocaleSelector
    UnityEngine.Localization.Settings.SystemLocaleSelector

UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1/<>c__DisplayClass58_0<System.Collections.Generic.IList`1<UnityEngine.Localization.Locale>>:<add_CompletedTypeless>b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<System.Collections.Generic.IList`1<UnityEngine.Localization.Locale>>)
DelegateList`1<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<System.Collections.Generic.IList`1<UnityEngine.Localization.Locale>>>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<System.Collections.Generic.IList`1<UnityEngine.Localization.Locale>>) (at Library/PackageCache/com.unity.addressables@1.18.2/Runtime/ResourceManager/Util/DelegateList.cs:69)
UnityEngine.ResourceManagement.ChainOperationTypelessDepedency`1<System.Collections.Generic.IList`1<UnityEngine.Localization.Locale>>:OnWrappedCompleted (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<System.Collections.Generic.IList`1<UnityEngine.Localization.Locale>>)
DelegateList`1<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<System.Collections.Generic.IList`1<UnityEngine.Localization.Locale>>>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<System.Collections.Generic.IList`1<UnityEngine.Localization.Locale>>) (at Library/PackageCache/com.unity.addressables@1.18.2/Runtime/ResourceManager/Util/DelegateList.cs:69)
UnityEngine.ResourceManagement.ChainOperationTypelessDepedency`1<System.Collections.Generic.IList`1<UnityEngine.Localization.Locale>>:OnWrappedCompleted (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<System.Collections.Generic.IList`1<UnityEngine.Localization.Locale>>)
DelegateList`1<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<System.Collections.Generic.IList`1<UnityEngine.Localization.Locale>>>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<System.Collections.Generic.IList`1<UnityEngine.Localization.Locale>>) (at Library/PackageCache/com.unity.addressables@1.18.2/Runtime/ResourceManager/Util/DelegateList.cs:69)
UnityEngine.ResourceManagement.ResourceManager:Update (single)
MonoBehaviourCallbackHooks:Update () (at Library/PackageCache/com.unity.addressables@1.18.2/Runtime/ResourceManager/Util/MonoBehaviourCallbackHooks.cs:26)

I added two locales. Seems everything is okay with them.
7202200--864865--screenshot1.png

I open the Addressables group, and do a clean build (clean all and then build).
On first playmode run, everything is fine. On the second playmode run I get the exception above in the spoiler.

Notes:

  • Unity 2021.2.0a17.2411 - I will downgrade though, maybe, although it’s fast. I can restart the editor without major waiting time which is very compelling. But it’s an alpha, after all.
  • Localization 1.0.0-pre.9
  • Addressables 1.18.2 (originally I installed 1.18.4, but downgraded to see if anything has to do with the problem above, apparently not)
  • After the exception shows up (second run), I go back, clean the addressables, rebuild, run, working. Second run, error.
  • My Addressables content is currently basic, nothing fancy.

    Any idea where to look?

If it’s a new project there’s a bug in addressables that was losing the label we add the to the locale. You can fix it by opening the Addressable window, Analyzers, Locale Analyzers and running it.

Okay, either I did something utterly stupid or one of the two (Addressables or Localization package) isn’t domain reload-off -safe. When I turn on the domain reload, the problem disappears. Now, I’ll recheck my code that I do not leave statics in funky state.

Yepp, reproduced in an empty project too only added the minimal things needed.

Try running the Locale Analyzer, if it finds an issue then its the Addressables bug. Once its fixed then its fine, it only happens the first time the AddressableAssets settings asset is created.

After select all and hit the Fix button this error message appears:

InvalidCastException: Specified cast is not valid.
(wrapper castclass) System.Object.__castclass_with_cache(object,intptr,intptr)
System.Linq.Enumerable+<CastIterator>d__34`1[TResult].MoveNext () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
UnityEditor.Localization.Addressables.TableAnalyzeRule`1[TTable].FixIssues (UnityEditor.AddressableAssets.Settings.AddressableAssetSettings settings) (at Library/PackageCache/com.unity.localization@1.0.0-pre.9/Editor/Addressables/StringTableAnalyzeRule.cs:222)
UnityEditor.AddressableAssets.Build.AnalyzeSystem.FixIssues (UnityEditor.AddressableAssets.Build.AnalyzeRules.AnalyzeRule rule) (at Library/PackageCache/com.unity.addressables@1.18.4/Editor/Build/AnalyzeRules/AnalyzeSystem.cs:193)
UnityEditor.AddressableAssets.GUI.AssetSettingsAnalyzeTreeView.<FixAllSelectedRules>b__5_0 (UnityEditor.AddressableAssets.GUI.AnalyzeRuleContainerTreeViewItem ruleContainer) (at Library/PackageCache/com.unity.addressables@1.18.4/Editor/GUI/AssetSettingsAnalyzeTreeView.cs:81)
UnityEditor.AddressableAssets.GUI.AssetSettingsAnalyzeTreeView.PerformActionForEntireRuleSelection (System.Action`1[T] action) (at Library/PackageCache/com.unity.addressables@1.18.4/Editor/GUI/AssetSettingsAnalyzeTreeView.cs:60)
UnityEditor.AddressableAssets.GUI.AssetSettingsAnalyzeTreeView.FixAllSelectedRules () (at Library/PackageCache/com.unity.addressables@1.18.4/Editor/GUI/AssetSettingsAnalyzeTreeView.cs:79)
UnityEditor.AddressableAssets.GUI.AnalyzeRuleGUI.<OnGUI>b__3_2 () (at Library/PackageCache/com.unity.addressables@1.18.4/Editor/GUI/AnalyzeRuleGUI.cs:49)
UnityEditor.EditorApplication.Internal_CallDelayFunctions () (at <0ba34cef20a14b1e8b24b1efe992a9d0>:0)

(Addressables 1.18.2 does the same)

After selecting the problematic entries one by one, the fixer fixed them, but the behavior stayed the same.

1 Like

Oh that looks like a bug. Can you just run the Locale rule? Not the asset table or StringTable one.

Already done. Same behavior. Also I found out it’s not the Addressables rebuild fix the issue for one play, the editor restart does. It really looks like something doesn’t like the lack of domain reload.

That’s strange. Could you file a bug report so we can look into it?

Sure!

Case #1340689

Thanks for the guidance, BTW!

1 Like

QA said it is the same issue: Unity Issue Tracker - [Localization] &quot;No Locale could be selected&quot; error when Play Mode Option &quot;Reload Domain&quot; is turned off

1 Like

FYI: with the Addressables Version 1.18.9 this problem is fixed.

1 Like