Search Unity

Bug Warnings, logs and errors after updating to Unity 2022.2.6f1

Discussion in 'Localization Tools' started by Reign_of_Light, Feb 13, 2023.

  1. Reign_of_Light

    Reign_of_Light

    Joined:
    Oct 15, 2014
    Posts:
    46
    Hi,

    I just updated Unity to 2022.2.6f1 (on Apple Silicon) and right after reimporting the project, the links to the Locale files were missing in both the 'Localization Settings.asset' file as well as the 'Localization Tables' window, but the locale files themselves were still there.
    So, I then clicked the "Add All" button in the localization settings and this solved the missing connections.

    However, when I then entered play-mode, I got a bunch of warnings, logs and errors.

    First came this warning:

    Code (CSharp):
    1. Schema asset already exists at path Assets/AddressableAssetsData/AssetGroups/Schemas/Built In Data_PlayerDataGroupSchema.asset, relinking.
    2. UnityEditor.AddressableAssets.Settings.AddressableAssetGroup:OnEnable () (at ./Library/PackageCache/com.unity.addressables@1.21.2/Editor/Settings/AddressableAssetGroup.cs:461)
    Now, upon game start I have this coroutine running to set the locale that has been loaded from the savegame:

    Code (CSharp):
    1. private IEnumerator SetLocaleOncePossible(string languageKey)
    2.         {
    3.             while (LocalizationSettings.AvailableLocales.Locales.Count == 0)
    4.                 yield return null;
    5.        
    6.             var locale = LocalizationSettings.AvailableLocales.GetLocale(languageKey);
    7.             LocalizationSettings.SelectedLocale = locale;
    8.         }
    This used to work just fine, but now as soon as I tried to access
    LocalizationSettings.AvailableLocales.Locales
    I got four times this error:


    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEditor.AddressableAssets.Settings.AddressableAssetGroupSchemaSet.GetSchema (System.Type type) (at ./Library/PackageCache/com.unity.addressables@1.21.2/Editor/Settings/AddressableAssetGroupSchemaSet.cs:186)
    3. UnityEditor.AddressableAssets.Settings.AddressableAssetGroup.GetSchema (System.Type type) (at ./Library/PackageCache/com.unity.addressables@1.21.2/Editor/Settings/AddressableAssetGroup.cs:283)
    4. UnityEditor.AddressableAssets.Settings.AddressableAssetGroup.GetSchema[TSchema] () (at ./Library/PackageCache/com.unity.addressables@1.21.2/Editor/Settings/AddressableAssetGroup.cs:273)
    5. UnityEditor.AddressableAssets.Settings.AddressableAssetSettingsLocator.RebuildInternalData () (at ./Library/PackageCache/com.unity.addressables@1.21.2/Editor/Build/AddressableAssetSettingsLocator.cs:139)
    6. UnityEditor.AddressableAssets.Settings.AddressableAssetSettingsLocator.Locate (System.Object key, System.Type type, System.Collections.Generic.IList`1[UnityEngine.ResourceManagement.ResourceLocations.IResourceLocation]& locations) (at ./Library/PackageCache/com.unity.addressables@1.21.2/Editor/Build/AddressableAssetSettingsLocator.cs:243)
    7. UnityEngine.AddressableAssets.AddressablesImpl.GetResourceLocations (System.Object key, System.Type type, System.Collections.Generic.IList`1[UnityEngine.ResourceManagement.ResourceLocations.IResourceLocation]& locations) (at ./Library/PackageCache/com.unity.addressables@1.21.2/Runtime/AddressablesImpl.cs:279)
    8. UnityEngine.AddressableAssets.AddressablesImpl.LoadAssetsAsync[TObject] (System.Object key, System.Action`1[T] callback, System.Boolean releaseDependenciesOnFailure) (at ./Library/PackageCache/com.unity.addressables@1.21.2/Runtime/AddressablesImpl.cs:753)
    9. UnityEngine.AddressableAssets.AddressablesImpl+<>c__DisplayClass91_0`1[TObject].<LoadAssetsWithChain>b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle op2) (at ./Library/PackageCache/com.unity.addressables@1.21.2/Runtime/AddressablesImpl.cs:742)
    10. UnityEngine.ResourceManagement.ChainOperationTypelessDepedency`1[TObject].Execute () (at ./Library/PackageCache/com.unity.addressables@1.21.2/Runtime/ResourceManager/AsyncOperations/ChainOperation.cs:191)
    11. UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject].InvokeExecute () (at ./Library/PackageCache/com.unity.addressables@1.21.2/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:536)
    12. UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject].Start (UnityEngine.ResourceManagement.ResourceManager rm, UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle dependency, DelegateList`1[T] updateCallbacks) (at ./Library/PackageCache/com.unity.addressables@1.21.2/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:531)
    13. UnityEngine.ResourceManagement.ResourceManager.StartOperation[TObject] (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject] operation, UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle dependency) (at ./Library/PackageCache/com.unity.addressables@1.21.2/Runtime/ResourceManager/ResourceManager.cs:530)
    14. UnityEngine.ResourceManagement.ResourceManager.CreateChainOperation[TObject] (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle dependentOp, System.Func`2[T,TResult] callback) (at ./Library/PackageCache/com.unity.addressables@1.21.2/Runtime/ResourceManager/ResourceManager.cs:911)
    15. UnityEngine.AddressableAssets.AddressablesImpl.LoadAssetsWithChain[TObject] (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle dep, System.Object key, System.Action`1[T] callback, System.Boolean releaseDependenciesOnFailure) (at ./Library/PackageCache/com.unity.addressables@1.21.2/Runtime/AddressablesImpl.cs:742)
    16. UnityEngine.AddressableAssets.AddressablesImpl.LoadAssetsAsync[TObject] (System.Object key, System.Action`1[T] callback, System.Boolean releaseDependenciesOnFailure) (at ./Library/PackageCache/com.unity.addressables@1.21.2/Runtime/AddressablesImpl.cs:750)
    17. UnityEngine.AddressableAssets.Addressables.LoadAssetsAsync[TObject] (System.Object key, System.Action`1[T] callback) (at ./Library/PackageCache/com.unity.addressables@1.21.2/Runtime/Addressables.cs:1312)
    18. UnityEngine.Localization.AddressablesInterface.LoadAssetsWithLabelInternal[TObject] (System.String label, System.Action`1[T] callback) (at ./Library/PackageCache/com.unity.localization@1.4.3/Runtime/Addressables/AddressablesInterface.cs:89)
    19. UnityEditor.Localization.EditorAddressablesInterface.LoadAssetsWithLabelInternal[TObject] (System.String label, System.Action`1[T] callback) (at ./Library/PackageCache/com.unity.localization@1.4.3/Editor/EditorAddressablesInterface.cs:157)
    20. UnityEngine.Localization.AddressablesInterface.LoadAssetsWithLabel[TObject] (System.String label, System.Action`1[T] callback) (at ./Library/PackageCache/com.unity.localization@1.4.3/Runtime/Addressables/AddressablesInterface.cs:79)
    21. UnityEngine.Localization.Settings.LocalesProvider.get_PreloadOperation () (at ./Library/PackageCache/com.unity.localization@1.4.3/Runtime/Settings/LocalesProvider.cs:48)
    22. UnityEngine.Localization.Settings.LocalesProvider.get_Locales () (at ./Library/PackageCache/com.unity.localization@1.4.3/Runtime/Settings/LocalesProvider.cs:25)
    23. Level.History.LoadSettingsCommand+<SetLocaleOncePossible>d__5.MoveNext () (at Assets/Game/Scripts/Level/History/LoadSettingsCommand.cs:61)
    Next, I updated the localization package to 1.4.3 (from 1.4.2) but that didn't help.

    Since the warning about
    Assets/AddressableAssetsData/AssetGroups/Schemas/Built In Data_PlayerDataGroupSchema.asset
    came first, I then tried deleting that file. And voilà, now everything works again.

    However, now I am constantly getting one warning and one log every time I enter play-mode.

    This is the warning:
    Code (CSharp):
    1. No script asset for PlayerDataGroupSchema. Check that the definition is in a file of the same name and that it compiles properly.
    (even though
    Built In Data_PlayerDataGroupSchema.asset
    has been rebuilt after I deleted it)

    And this is the log:
    Code (CSharp):
    1. Unable to find BuildScriptFastMode or subclass builder in settings assets. Using default Instance and Scene Providers.
    2. UnityEngine.Localization.Settings.LocalesProvider:get_Locales ()
    3. Level.History.LoadSettingsCommand/<SetLocaleOncePossible>d__5:MoveNext () (at Assets/Game/Scripts/Level/History/LoadSettingsCommand.cs:61)
    In the referenced line
    LoadSettingsCommand.cs:61
    I am again just accessing

    LocalizationSettings.AvailableLocales.Locales
    .

    Now, I am not very familiar with addressables, unfortunately, so I do not know if this is a localization or addressables issue. Does anyone have an idea what I did wrong and why this warning and log appear and also how to possibly fix them?
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,300
    Reign_of_Light likes this.
  3. Reign_of_Light

    Reign_of_Light

    Joined:
    Oct 15, 2014
    Posts:
    46
    Thank you for the quick response! I didn't know about the Addressables Analyzers and sure enough they got rid of the warning.

    However, the log still comes up on every first attempt to access

    LocalizationSettings.AvailableLocales.Locales
    . Are you sure this is coming from the Addressables system as it appears to be thrown from the LocalesProvider and mentions the "settings assets"? Hm, as I cannot find that log anywhere in code (and neither via Google), it might indeed just be hidden somewhere deeper.

    Code (CSharp):
    1. Unable to find BuildScriptFastMode or subclass builder in settings assets. Using default Instance and Scene Providers.
    2. UnityEngine.Localization.Settings.LocalesProvider:get_Locales ()
    Annoying to have that come up every time, but at least it seems to work without further issues.

    Ah, and I didn't delete the Addressables folder, only that one file where the warning was about. Should I have deleted the Addressables folder or is that something I should try?
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,300
    It sounds like you have lost a lot of configuration files during your upgrade. Try clicking on the localization settings asset, it should have a warning at the top saying you don't have a default settings file. There should be a button to fix it.
    You don't need to delete files from the addressables folder, the analyzer should be able to fix the problems.
     
    Reign_of_Light likes this.
  5. Reign_of_Light

    Reign_of_Light

    Joined:
    Oct 15, 2014
    Posts:
    46
    Thank you, but no, the localization settings asset does not show a warning. After my manual adjustments it all works except for that debug-log showing up each time.
    I now went back in git to before the upgrade and repeated it from scratch for the third time in order to see if the Addressables Analyzers could fix all issues from the start. Unfortunately, they cannot. Whatever I do and whichever rule I try to analyze, Addressables Analyze does not even run but gets stuck for hours at "Calculating Input Definitions".

    I think I have to link up everything manually, again, and live with that debug-log. That or not update Unity for now!

    Or, if there was a way to regenerate all localization-related files without losing the string tables, that would be cool!
     
    Last edited: Feb 13, 2023
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,300
    Are you able to share the version of the project before the upgrade so I can see whats going wrong?
     
  7. Reign_of_Light

    Reign_of_Light

    Joined:
    Oct 15, 2014
    Posts:
    46
    I am not sure how. The project folder is 15 Gb big. Maybe via git where the project is much smaller, thanks to git ignoring some large (hopefully) unused assets, but I'm working solo so I never tried cloning the repo on another system. It could very well be missing files.

    Personally, I'm fine with simply not upgrading at the moment. But at some point I'd of course like to, so if I can help resolve the issue, I'd be happy to.
     
  8. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,300
    Missing files certainly would explain the problem. You don't need the library folder, so that should reduce the size. I'd be happy to take a quick look
     
  9. Reign_of_Light

    Reign_of_Light

    Joined:
    Oct 15, 2014
    Posts:
    46
    No, I meant in git there could be missing files (due to me using the .gitignore extensively) which are not missing on my PC (just in git). So that certainly is not a cause for the problems I am having.

    To avoid this, I have copied my project folder and deleted the library folder plus some large assets, like you suggested. Now, I am down to 3.6 gigabytes. Do you have a preferred way of how I could send it to you? Wetransfer? Or is there something else?
     
  10. Reign_of_Light

    Reign_of_Light

    Joined:
    Oct 15, 2014
    Posts:
    46
    Now, that is interesting. I stripped the project further down to just 287.7 Mb by deleting most of the game and the installed plugins. The only thing that remains is the main menu which I thought should be enough for upgrading and testing localization.

    Interestingly, under those stripped down circumstances the upgrade worked without issues. So there must be some interference with another plugin or asset. But which one, that is the question..
     
    Last edited: Feb 14, 2023
  11. Reign_of_Light

    Reign_of_Light

    Joined:
    Oct 15, 2014
    Posts:
    46
    Okay, the problem solved itself completely by first deleting the Library folder before doing the upgrade.

    Thank you for your many quick responses, Karl, which ultimately lead me to the (or my) solution.
     
  12. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,300
    Ah, great news. :)
     
    SparkesRS and Reign_of_Light like this.