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.
  2. Dismiss Notice

LocalizationSettings cannot be loaded when deployed on Android device.

Discussion in 'Localization Tools' started by zgrkpnr89, Jun 13, 2020.

  1. mmekies

    mmekies

    Joined:
    Aug 26, 2020
    Posts:
    12
    Il get on it and report back ASAP , thank you
     
    karl_jones likes this.
  2. loiz

    loiz

    Joined:
    Apr 4, 2021
    Posts:
    3
    Hello, I need some help when add a localization tables and then click default build script in addressable groups given the error:
    consoleerror.PNG
    I run the steps about addressables but until nothing. Someone can help me?

    Versions:
    Unity 2020.18.3.18f
    Addressables 1.19.4
    Localization 1.0.0
     
  3. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,845
    Can you share the full editor log?
     
    loiz likes this.
  4. loiz

    loiz

    Joined:
    Apr 4, 2021
    Posts:
    3
    Editor log, thanks!
     

    Attached Files:

  5. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,845
    There's nothing in the log file to help. I think your addressable settings may be corrupted. Try deleting the Addressable assets folder in the project and then run the localization addressables Analyzers to re generate the settings.
     
    loiz likes this.
  6. loiz

    loiz

    Joined:
    Apr 4, 2021
    Posts:
    3
    It
    Worked! Thanks a lot!
     
    karl_jones likes this.
  7. Michael_Mekies

    Michael_Mekies

    Joined:
    Jul 5, 2021
    Posts:
    2
    Hello Karl, I'm back with some news about the addressable issues I was getting with localization, some good some bad. I copied my exact build and player settings from the main application in a stand alone app to see if the old 2020.3.0f1 engine was the culprit. Turns out it was the issue as I updated to the new engine 2020.3.18f1 and the built standalone worked. I went back to the main app , removed the localization and addressable packages , brought them back in and created new tables from scratch and built the addressables, everything seemed promising until I built the application. I received the same error logs that I previously had. I'm starting to loose hope , I would greatly appreciate some help.
    here is my addressable groups:
    upload_2021-9-18_15-47-42.png
    I attached the error logs I was getting in the main app.
    Addressable package : 1.17.15
    Localization package 0.11.1 preview
     

    Attached Files:

  8. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,845
    Can you try the latest version of the localization package? If that fails please file a bug report so I can take a look at the project and see what's going wrong.
     
    Michael_Mekies likes this.
  9. mmekies

    mmekies

    Joined:
    Aug 26, 2020
    Posts:
    12
    Hello Karl,
    Good news and Bad news. I have everything up to date (addressables, localization) and I am able to build a working stand alone of our application which localizes! , yet when we send it through our Build PC it builds the application without the localization addressables which results in the same error logs as I posted previously (above), Is there any light you can shed on this ?
     
  10. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,845
    Sounds like your build pc needs to build addressables as part of the build process.
    There's an API you can call to build them.
     
  11. mmekies

    mmekies

    Joined:
    Aug 26, 2020
    Posts:
    12
    Hello Karl,
    I have a
    I attempted to take another shot at localizing the application. We are still having issues with addressable. Locally in the application worked , but when it was sent to the build pc it did not. I attached the logs , please help :)
     

    Attached Files:

  12. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,845
    Looks like the addresable assets have not been built on the build machine.
    Try doing AddressableAssetSettings.BuildPlayerContent(); in your build script.
     
  13. mmekies

    mmekies

    Joined:
    Aug 26, 2020
    Posts:
    12
    Hello Karl,
    Is it possible that there are specific build settings that can trigger the building of the addressable upon the remote build on the build PC , or must we add the line of code you have posted?
     
  14. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,845
    Im not aware of any. If you are using cloud build then there is a setting to do this in the cloud build dashboard. Otherwise, you will need to trigger it with a script before the build like you say.
     
  15. mmekies

    mmekies

    Joined:
    Aug 26, 2020
    Posts:
    12
    Hello Karl,
    If we do go with the route of triggering through script , how do we go about it ? Is there any examples you can show ?
     
  16. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,845
  17. mmekies

    mmekies

    Joined:
    Aug 26, 2020
    Posts:
    12
    Hello Karl,
    We have implemented the building of the addressables within the pipeline without any errors, The build is successful, yet we still have an error when trying to change locales in play mode.
    This is the functions used to build the addressables that is called in the pipeline, by powershell, before the building of the app:

    /// <summary>
    /// Run a clean build before export.
    /// </summary>
    static public void PreExport()
    {
    Debug.Log("BuildAddressablesProcessor.PreExport start");
    AddressableAssetSettings.CleanPlayerContent(
    AddressableAssetSettingsDefaultObject.Settings.ActivePlayerDataBuilder);
    AddressableAssetSettings.BuildPlayerContent();
    Debug.Log("BuildAddressablesProcessor.PreExport done");
    }

    I attatched the error logs.
     

    Attached Files:

  18. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,845
    That error doesn't look like it's caused by missing addressables.
    This can be caused by using an addressable handle that has been released.
    Are you able to share the full log file?
     
  19. mmekies

    mmekies

    Joined:
    Aug 26, 2020
    Posts:
    12
    I have attatch all the errors I have received .
    errors 1-3 happen when trying to load the localized string from localized string event component , and error 4 is when the user selects a different language a.k.a switch locales
     

    Attached Files:

  20. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,845
    That does seem to imply that the data was not built. What platform are you building to? Does it work if you do a manual build locally?

    This is caused by the previous error

    What version of Unity are you using? This is an old bug that should be fixed on the latest patch version.

    Likely related to the previous errors.

    Can you try updating to the latest patch version of Unity and the package?
    Also try a local build so we know it works normally.
     
  21. mmekies

    mmekies

    Joined:
    Aug 26, 2020
    Posts:
    12


    Building to both android and ios. The build works perfectly when built locally.

    We are using Unity 2020.3.18.f1 , is it necessary to upgrade version , as it is not the easiest process.
     
  22. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,845
    Sounds like the automated building is the problem. This is not an area of my expertise, you would have more luck asking in the addressables section https://forum.unity.com/forums/addressables.156/ or maybe ask on the original thread https://forum.unity.com/threads/aut...-script-ie-variation-in-example-repo.1073480/
     
  23. MaryamRasheed

    MaryamRasheed

    Joined:
    Jan 25, 2021
    Posts:
    6
    hey, I have been getting this error that five other languages are working but there are only two languages that sometimes work sometimes doesn't in build. Can you point out what could be the issue? @karl_jones
     
  24. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,845
    What are the 2 languages that dont work?

    What version of the package are you using?
    Do you get any errors?
     
  25. MaryamRasheed

    MaryamRasheed

    Joined:
    Jan 25, 2021
    Posts:
    6
    It was because of some issue with unity cloud build. It is working now.
    The other issue I am getting is that, on android it is detecting the system language and the app translates into the detected language but in IOS it is not working. It uses the default language that is English and then changes language based on the language saved in prefs. Is there some other setting for IOS, that we need to do.
     
  26. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,845
    Did you add the iOS App Info metadata? https://docs.unity3d.com/Packages/com.unity.localization@1.3/manual/iOS-App-Localization.html
     
  27. MaryamRasheed

    MaryamRasheed

    Joined:
    Jan 25, 2021
    Posts:
    6
    I haven't yet but aren't these for system message requests?
     
  28. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,845
    Yes, but it's also needed to ensure we set up iOS. Try adding it but leaving the fields empty.
     
  29. unity_B5445D5953B43EFE2C55

    unity_B5445D5953B43EFE2C55

    Joined:
    May 23, 2022
    Posts:
    5
    HI I am issue with the localization game is getting stuck after splash screen this is what I get in XCode logs. I rebuild and did everything in guide. please assist

    System.Action`2:Invoke(T1, T2)
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:set_OperationException(Exception)
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:Complete(TObject, Boolean, Exception, Boolean)
    UnityEngine.Localization.Operations.WaitForCurrentOperationAsyncOperationBase`1:InvokeWaitForCompletion()
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:WaitForCompletion()
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle:WaitForCompletion()
    UnityEngine.Localization.Operations.WaitForCurrentOperationAsyncOperationBase`1:InvokeWaitForCompletion()
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:WaitForCompletion()
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle:WaitForCompletion()
    UnityEngine.Localization.Operations.WaitForCurrentOperationAsyncOperationBase`1:InvokeWaitForCompletion()
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:WaitForCompletion()
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1:WaitForCompletion()
    UnityEngine.Localization.LocalizedString:HandleLocaleChange(Locale)
    UnityEngine.Localization.LocalizedString:ForceUpdate()
    UnityEngine.Localization.LocalizedString:add_StringChanged(ChangeHandler)

    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 39)
     
  30. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,845
    Looks like you only posted a partial call stack. Do you have the full log file or error message?
     
  31. unity_B5445D5953B43EFE2C55

    unity_B5445D5953B43EFE2C55

    Joined:
    May 23, 2022
    Posts:
    5
    Here is the Full Log. Things I want to mention I did build the Assets bundle I also tried updating addressable. I also did include IOS metadata in Localization Settings not sure if there is any mistake there and Localization working fine inside editor. Thanks For your response please take a look here is the full log.
     

    Attached Files:

    • Logs.txt
      File size:
      95.2 KB
      Views:
      120
    Last edited: Jan 3, 2023
  32. unity_B5445D5953B43EFE2C55

    unity_B5445D5953B43EFE2C55

    Joined:
    May 23, 2022
    Posts:
    5
  33. Heero888

    Heero888

    Joined:
    Jun 18, 2017
    Posts:
    57
    Hi,

    I have this error also when build on Android. Works fine in editor. What is the latest fix for this? I am using

    Unity 2020.3.43
    Addressables 1.20.5
    Localization 1.4.3


    MissingMethodException: Default constructor not found for type UnityEngine.ResourceManagement.ResourceManager+CompletedOperation`1[[System.Collections.Generic.IList`1[[UnityEngine.Localization.Locale, Unity.Localization, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
    System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) (at <00000000000000000000000000000000>:0)
    System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) (at <00000000000000000000000000000000>:0)
    UnityEngine.ResourceManagement.Util.LRUCacheAllocationStrategy.New (System.Type type, System.Int32 typeHash) (at <00000000000000000000000000000000>:0)
    UnityEngine.ResourceManagement.ResourceManager.CreateOperation[T] (System.Type actualType, System.Int32 typeHash, UnityEngine.ResourceManagement.Util.IOperationCacheKey cacheKey, System.Action`1[T] onDestroyAction) (at <00000000000000000000000000000000>:0)
    UnityEngine.ResourceManagement.ResourceManager.CreateCompletedOperationInternal[TObject] (TObject result, System.Boolean success, System.Exception exception, System.Boolean releaseDependenciesOnFailure) (at <00000000000000000000000000000000>:0)
    UnityEngine.ResourceManagement.ResourceManager.CreateCompletedOperationWithException[TObject] (TObject result, System.Exception exception) (at <00000000000000000000000000000000>:0)
    UnityEngine.AddressableAssets.AddressablesImpl.LoadAssetsAsync[TObject] (System.Object key, System.Action`1[T] callback, System.Boolean releaseDependenciesOnFailure) (at <00000000000000000000000000000000>:0)
    UnityEngine.AddressableAssets.Addressables.LoadAssetsAsync[TObject] (System.Object key, System.Action`1[T] callback) (at <00000000000000000000000000000000>:0)
    UnityEngine.Localization.AddressablesInterface.LoadAssetsWithLabelInternal[TObject] (System.String label, System.Action`1[T] callback) (at <00000000000000000000000000000000>:0)
    UnityEngine.Localization.AddressablesInterface.LoadAssetsWithLabel[TObject] (System.String label, System.Action`1[T] callback) (at <00000000000000000000000000000000>:0)
    UnityEngine.Localization.Settings.LocalesProvider.get_PreloadOperation () (at <00000000000000000000000000000000>:0)
    UnityEngine.Localization.Settings.LocalizationSettings.GetSelectedLocaleAsync () (at <00000000000000000000000000000000>:0)
    UnityEngine.Localization.Settings.LocalizationSettings.get_SelectedLocaleAsync () (at <00000000000000000000000000000000>:0)
    UnityEngine.Localization.Settings.LocalizedDatabase`2[TTable,TEntry].GetTableAsync (UnityEngine.Localization.Tables.TableReference tableReference, UnityEngine.Localization.Locale locale) (at <00000000000000000000000000000000>:0)
    UnityEngine.Localization.Settings.LocalizedDatabase`2[TTable,TEntry].GetTableEntryAsync (UnityEngine.Localization.Tables.TableReference tableReference, UnityEngine.Localization.Tables.TableEntryReference tableEntryReference, UnityEngine.Localization.Locale locale, UnityEngine.Localization.Settings.FallbackBehavior fallbackBehavior) (at <00000000000000000000000000000000>:0)
    UnityEngine.Localization.LocalizedString.HandleLocaleChange (UnityEngine.Localization.Locale _) (at <00000000000000000000000000000000>:0)
    UnityEngine.Localization.LocalizedString.ForceUpdate () (at <00000000000000000000000000000000>:0)
    UnityEngine.Localization.LocalizedString.add_StringChanged (UnityEngine.Localization.LocalizedString+ChangeHandler value) (at <00000000000000000000000000000000>:0)
     
  34. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,845
    What version of the package are you using? 1.4.3 is the latest
     
  35. Heero888

    Heero888

    Joined:
    Jun 18, 2017
    Posts:
    57
    using 1.4.3.
    Right now my solution is to clear to addressiable cache and create a new one every time I update the localization table. Just couple more clicks, it works for me.
     
    karl_jones likes this.
  36. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,845
    That's strange. I believe this error is coming from the managed code stripping although addressables does generate a file to prevent this so it's strange that it's happening.