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.

Bug Player crash since Localization was integrated - "Expected to have a current operation to wait on."

Discussion in 'Localization Tools' started by Wilomomo, Nov 28, 2022.

  1. Wilomomo

    Wilomomo

    Joined:
    Jul 6, 2017
    Posts:
    6
    Hello everyone,
    I'm currently run in an issue since I integrated Localization in our project.
    So:
    I'm using Unity 2020.3.34f1 (on Windows 10), and Localization 1.4.2
    When I'm trying to run a Player version, the game crash on the splash screen.

    At the begining, I got some errors with the adressable, the error was, in player.log :
    "RuntimeData is null. Please ensure you have built the correct Player Content. Addressables - Unable to load runtime data at location".
    After some search, I follow the instructions in this posts :
    https://forum.unity.com/threads/loc...not-in-a-compiled-build.1055630/#post-6828803
    But that didn't fully fix the problem, the problem is still here, but this error gone to let place to another one
    "OperationException : Expected to have a current operation to wait on. Can not complete."

    The full logs of development build is at the end of this post

    What I've already tried
    - Build adressables
    - Clear and rebuild adressables
    - Remove "Append Filename and Hash"


    Sorry for this long post, I tried to use the "Unity Bug Reporter", but this one stay on "Uploading 100%" since an hour =/

    The full logs of development build :
    Mono path[0] = 'C:/Users/AlexandreMorize/Desktop/TestAlpha2/Voodolls_Data/Managed'
    Mono config path = 'C:/Users/AlexandreMorize/Desktop/TestAlpha2/MonoBleedingEdge/etc'
    PlayerConnection initialized from C:/Users/AlexandreMorize/Desktop/TestAlpha2/Voodolls_Data (debug = 0)
    PlayerConnection initialized network socket : 0.0.0.0 55168
    Multi-casting "[IP] 192.168.22.160 [Port] 55168 [Flags] 2 [Guid] 1322732445 [EditorId] 372925965 [Version] 1048832 [Id] WindowsPlayer(DESKTOP-03) [Debug] 0 [PackageName] WindowsPlayer [ProjectName] Voodolls" to [225.0.0.222:54997]...
    Started listening to [0.0.0.0:55168]
    PlayerConnection already initialized - listening to [0.0.0.0:55168]
    Initialize engine version: 2020.3.34f1 (9a4c9c70452b)
    [Subsystems] Discovering subsystems at path C:/Users/AlexandreMorize/Desktop/TestAlpha2/Voodolls_Data/UnitySubsystems
    GfxDevice: creating device client; threaded=1
    Direct3D:
    Version: Direct3D 11.0 [level 11.1]
    Renderer: NVIDIA GeForce RTX 3070 (ID=0x2484)
    Vendor:
    VRAM: 8043 MB
    Driver: 31.0.15.1694
    Begin MonoManager ReloadAssembly
    - Completed reload, in 0.294 seconds
    <RI> Initializing input.
    New input system (experimental) initialized
    <RI> Initialized touch support.
    The referenced script on this Behaviour (Game Object 'PersistanceSystem') is missing!
    The referenced script on this Behaviour (Game Object 'Iselin_AFAC') is missing!
    UnloadTime: 1.445300 ms
    OperationException : Expected to have a current operation to wait on. Can not complete.
    UnityEngine.StackTraceUtility:ExtractStackTrace ()
    UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    UnityEngine.Logger:Log (UnityEngine.LogType,object)
    UnityEngine.Debug:LogError (object)
    UnityEngine.AddressableAssets.AddressablesImpl:LogException (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle,System.Exception) (at C:/Users/AlexandreMorize/Documents/GitHub/Voodolls/Library/PackageCache/com.unity.addressables@1.20.5/Runtime/AddressablesImpl.cs:219)
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1<UnityEngine.Localization.Settings.LocalizationSettings>:set_OperationException (System.Exception) (at C:/Users/AlexandreMorize/Documents/GitHub/Voodolls/Library/PackageCache/com.unity.addressables@1.20.5/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:348)
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1<UnityEngine.Localization.Settings.LocalizationSettings>:Complete (UnityEngine.Localization.Settings.LocalizationSettings,bool,System.Exception,bool) (at C:/Users/AlexandreMorize/Documents/GitHub/Voodolls/Library/PackageCache/com.unity.addressables@1.20.5/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:488)
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1<UnityEngine.Localization.Settings.LocalizationSettings>:Complete (UnityEngine.Localization.Settings.LocalizationSettings,bool,string,bool) (at C:/Users/AlexandreMorize/Documents/GitHub/Voodolls/Library/PackageCache/com.unity.addressables@1.20.5/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:451)
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1<UnityEngine.Localization.Settings.LocalizationSettings>:Complete (UnityEngine.Localization.Settings.LocalizationSettings,bool,string) (at C:/Users/AlexandreMorize/Documents/GitHub/Voodolls/Library/PackageCache/com.unity.addressables@1.20.5/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:435)
    UnityEngine.Localization.Operations.WaitForCurrentOperationAsyncOperationBase`1<UnityEngine.Localization.Settings.LocalizationSettings>:InvokeWaitForCompletion () (at C:/Users/AlexandreMorize/Documents/GitHub/Voodolls/Library/PackageCache/com.unity.localization@1.4.2/Runtime/Operations/WaitForCurrentOperationAsyncOperationBase.cs:40)
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1<UnityEngine.Localization.Settings.LocalizationSettings>:WaitForCompletion () (at C:/Users/AlexandreMorize/Documents/GitHub/Voodolls/Library/PackageCache/com.unity.addressables@1.20.5/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:172)
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle:WaitForCompletion () (at C:/Users/AlexandreMorize/Documents/GitHub/Voodolls/Library/PackageCache/com.unity.addressables@1.20.5/Runtime/ResourceManager/AsyncOperations/AsyncOperationHandle.cs:592)
    UnityEngine.Localization.Operations.WaitForCurrentOperationAsyncOperationBase`1<UnityEngine.Localization.Tables.StringTable>:InvokeWaitForCompletion () (at C:/Users/AlexandreMorize/Documents/GitHub/Voodolls/Library/PackageCache/com.unity.localization@1.4.2/Runtime/Operations/WaitForCurrentOperationAsyncOperationBase.cs:32)
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1<UnityEngine.Localization.Tables.StringTable>:WaitForCompletion () (at C:/Users/AlexandreMorize/Documents/GitHub/Voodolls/Library/PackageCache/com.unity.addressables@1.20.5/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:172)
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle:WaitForCompletion () (at C:/Users/AlexandreMorize/Documents/GitHub/Voodolls/Library/PackageCache/com.unity.addressables@1.20.5/Runtime/ResourceManager/AsyncOperations/AsyncOperationHandle.cs:592)
    UnityEngine.Localization.Operations.WaitForCurrentOperationAsyncOperationBase`1<UnityEngine.Localization.Settings.LocalizedDatabase`2/TableEntryResult<UnityEngine.Localization.Tables.StringTable, UnityEngine.Localization.Tables.StringTableEntry>>:InvokeWaitForCompletion () (at C:/Users/AlexandreMorize/Documents/GitHub/Voodolls/Library/PackageCache/com.unity.localization@1.4.2/Runtime/Operations/WaitForCurrentOperationAsyncOperationBase.cs:32)
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1<UnityEngine.Localization.Settings.LocalizedDatabase`2/TableEntryResult<UnityEngine.Localization.Tables.StringTable, UnityEngine.Localization.Tables.StringTableEntry>>:WaitForCompletion () (at C:/Users/AlexandreMorize/Documents/GitHub/Voodolls/Library/PackageCache/com.unity.addressables@1.20.5/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:172)
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle:WaitForCompletion () (at C:/Users/AlexandreMorize/Documents/GitHub/Voodolls/Library/PackageCache/com.unity.addressables@1.20.5/Runtime/ResourceManager/AsyncOperations/AsyncOperationHandle.cs:592)
    UnityEngine.Localization.Operations.WaitForCurrentOperationAsyncOperationBase`1<string>:InvokeWaitForCompletion () (at C:/Users/AlexandreMorize/Documents/GitHub/Voodolls/Library/PackageCache/com.unity.localization@1.4.2/Runtime/Operations/WaitForCurrentOperationAsyncOperationBase.cs:32)
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1<string>:WaitForCompletion () (at C:/Users/AlexandreMorize/Documents/GitHub/Voodolls/Library/PackageCache/com.unity.addressables@1.20.5/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:172)
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<string>:WaitForCompletion () (at C:/Users/AlexandreMorize/Documents/GitHub/Voodolls/Library/PackageCache/com.unity.addressables@1.20.5/Runtime/ResourceManager/AsyncOperations/AsyncOperationHandle.cs:188)
    UnityEngine.Localization.LocalizedString:GetLocalizedString () (at C:/Users/AlexandreMorize/Documents/GitHub/Voodolls/Library/PackageCache/com.unity.localization@1.4.2/Runtime/Localized Reference/LocalizedString.cs:273)
    LocalizeUIText:Awake () (at C:/Users/AlexandreMorize/Documents/GitHub/Voodolls/Assets/Scripts/UI/LocalizeUIText.cs:21)
    (Filename: C:/Users/AlexandreMorize/Documents/GitHub/Voodolls/Library/PackageCache/com.unity.addressables@1.20.5/Runtime/AddressablesImpl.cs Line: 219)
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,058
    I have seen another user post this issue. Are you able to file a bug report? They were unable to reproduce it so we still dont know what the cause is.
    The solution that worked for them was to call GetLocalizedStringAsync instead of GetLocalizedString.
     
  3. Wilomomo

    Wilomomo

    Joined:
    Jul 6, 2017
    Posts:
    6
    Yesterday, I was unable to...
    I'll try today from another PC

    I'll try with GetLocalizedStringAsync too, I'll give you more feedback asap =)
     
    karl_jones likes this.
  4. Bumpalump

    Bumpalump

    Joined:
    Dec 26, 2020
    Posts:
    12
    Also having crash with newest 1.4.2 version of Localization. In editor everything looks ok but crashes in build.
    Downgraded to 1.3.2 and all works normally.
    Using unity 2021.3.3f.
     
  5. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,058
    Could you please file a bug report?
     
  6. Bumpalump

    Bumpalump

    Joined:
    Dec 26, 2020
    Posts:
    12
    What would be proper procedure for that? Do I post it here on forums or some other method? Also which logs do you need? I can do a quick install of 1.4.2 and reproduce the crash easily - it happens each time with this version but only in build, not in editor.
     
  7. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,058
    Please follow this process https://unity3d.com/unity/qa/bug-reporting
     
  8. frank-ijsfontein

    frank-ijsfontein

    Joined:
    Sep 11, 2015
    Posts:
    16
    I had to do this in my initialization script:

    Code (CSharp):
    1. if (!LocalizationSettings.InitializeSynchronously)
    2. {
    3.     LocalizationSettings.InitializationOperation.WaitForCompletion();
    4. }
    to avoid the error mentioned in the subject of this thread.

    In the Editor I didn't get the error, only in a build. I have InitializeSynchronously set to true so actually there's no InitializationOperation to wait for, I guess.
    This is in Unity 2022.1.23, using Localization 1.4.2
     
  9. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,058
    Could you please file a bug report so we can figure out why you need to do this?
     
  10. Knipsch

    Knipsch

    Joined:
    Sep 12, 2018
    Posts:
    7
    I got the same error today, and downgrading Localization to version 1.3.2 fixed it for me.
     
  11. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,058
    Are you able to file a bug report with the project or a sample project that shows the issue?
     
  12. Knipsch

    Knipsch

    Joined:
    Sep 12, 2018
    Posts:
    7
    Yep, just submitted one. Do you need any info from me to make it easier for you to find that bug report?
     
    karl_jones likes this.
  13. dlorre

    dlorre

    Joined:
    Apr 12, 2020
    Posts:
    450
    I have this error message while testing on my laptop which is much slower than my dev computer. I have no reference to localization in logs but I googled the message and found this thread.
     
  14. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,058
    Do you have the bug number?
     
  15. Knipsch

    Knipsch

    Joined:
    Sep 12, 2018
    Posts:
    7
    It seems to be IN-25823.
     
    karl_jones likes this.
  16. forestrf

    forestrf

    Joined:
    Aug 28, 2010
    Posts:
    157
    I also got this problem and was able to make a small repro scene with close to the minimum code required for it.
    I think it's related to loading synchronously a translation and it being the first translation ever loaded since the game started.

    Case: CASE IN-26684

    Also it seems there's no locale chosen on the editor until the Play button is pressed, this is annoying when working with translations inside the editor as they seem to not work until then.
    Included in the repro scene there's this mod I made which I like more than the default as it's less intrusive in the game view.
    upload_2022-12-22_4-6-26.png

    Edit: Using GetLocalizedStringAsync doesn't seem to work if instead of using the event "Completed" I store the AsyncOperationHandle and use .IsDone and .Result when I'm ready to use it.
    I don't know what it's the real problem but at least it seems to fail every time, so it should be a good repro case.
     
    Last edited: Dec 22, 2022
    karl_jones likes this.
  17. EduardoSeitz

    EduardoSeitz

    Joined:
    May 11, 2019
    Posts:
    3
    I also had this same error in Unity 2021.3.1 personal, it only happens on physical android devices and not in the editor. Fixed it by changing the line in the manifest.json from "com.unity.localization": "1.4.2" to "com.unity.localization": "1.4.0-exp.1".
     
  18. EduardoSeitz

    EduardoSeitz

    Joined:
    May 11, 2019
    Posts:
    3
    The exact error I was getting is:
    2023/01/03 20:46:46.880 7032 7109 Error Unity OperationException : Expected to have a current operation to wait on. Can not complete.
     
  19. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,058
    It was likely fixed by one of the bug fixes in 1.4.2.
     
  20. hwibaek2827

    hwibaek2827

    Joined:
    May 2, 2022
    Posts:
    3
    The bug still hasn't been fixed in 1.4.2
     
  21. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,058
    Could you please file a bug report?
     
  22. hwibaek2827

    hwibaek2827

    Joined:
    May 2, 2022
    Posts:
    3
    I sended
     
    karl_jones likes this.
  23. Ludiq

    Ludiq

    Joined:
    Mar 6, 2015
    Posts:
    771
    Can confirm I'm still getting this hang in the player only.

    Localization 1.4.2
    Unity 2020.3.43f1
     
  24. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,058
    Do you have the bug number? Nothing has come through to us yet, it could be stuck with QA.
     
  25. Ludiq

    Ludiq

    Joined:
    Mar 6, 2015
    Posts:
    771
    After more experimentation, I think this was caused by the adressables data being corrupt. I deleted the AdressablesData folder, rebuilt it, ran the analyzer, etc., and now that error message is gone and the build runs fine.
     
    karl_jones likes this.
  26. Ludiq

    Ludiq

    Joined:
    Mar 6, 2015
    Posts:
    771
    Apologies, I spoke too fast; it only fixed the hang because I hadn't actually built the addressables for the player, thus the locales were null in game and the hang was presumably moot because it failed earlier in the chain. The issue is indeed still present now that I have built the addressables.

    However, as indicated by another reporter, reverting to 1.3.2 fixes it, so it seems the regression happened between these two versions. I did not personally test 1.4.0-exp.1 as I prefer sticking to stable releases.
     
  27. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,058
    Could you please file a bug report? https://unity.com/releases/editor/qa/bug-reporting