Using Unity 2019.4.20f1, Addressables 1.18.4 and Localization 1.0.0-pre.9
This is a pretty big issue for me. I hope there is a workaround or fix on the way
Calling Addressables.DownloadDependenciesAsync
to download a localization (stringtable) update causes Unity to output the following error:
System.Exception: Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown.,
Key=localization-string-tables-english(en)_assets_all_19ac7c008226fffe203c44a1db5ec43c.bundle, Type=System.Object
The problem occurs when the game displays or displayed localized text before downloading the new content.
It’s very much necessary to display localized text before downloading new content, for example to display a “A content update is available. It’s recommended to connect with Wi-Fi” message to the user before the update.
I’ve attached two videos to the bug-report. The video posted in this thread is the “short” version of the two, that gets to the point more quickly.
Reproduce
- Open project on Windows
- Open “Addressables Profiles” window and activate “Editor Hosted”
- Open “Addressables Hosting” window and disable the service
- Open “Addressables Groups” window and choose “Use existing Build” in the “Play Mode Script” dropdown
- Select all “Assets/AddressableAssetsData/AssetGroups/Localization-” assets
- In the Inspector, set all Localization-* assets to BuildPath=LocalBuildPath and LoadPath=LocalLoadPath
- Click in the Addressables Groups window “Build > Clean Build > All”
- Click in the Addressables Groups window “Build > New Build > Default Build Script”
- Press from main menu “File > Build and Run”
- In the Player press “Check for Catalog Update”
- In the Player press “Check for new Content”
- Close Player, switch back to Unity
- Open “Window > Asset Management > Localization Tables”
- Change english and german text
- Select all “Assets/AddressableAssetsData/AssetGroups/Localization-” assets
- In the Inspector, set all Localization-* assets to BuildPath=RemoteBuildPath and LoadPath=RemoteLoadPath
- Click in the Addressables Groups window “Build > New Build > Default Build Script”
- Run earlier built player (do NOT build it again at this time)
- In the Player press “Check for Catalog Update”
- In the Player press “Check for new Content”
Actual
Localization or Addressables causes System.Exception.
Expected
Localization can be updated via Addressables content update.
Notes
If you want to test this multiple times, it seems you need to delete “C:\Users%UserName%\AppData\LocalLow\DefaultCompany\AddressablesContentUpdate_3”
Notes 2
Here is explained why the Local & Remote Build/LoadPath changes are necessary: How to have the same bundles as local and remote?
System.Exception: Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=localization-string-tables-english(en)_assets_all_19ac7c008226fffe203c44a1db5ec43c.bundle, Type=System.Object
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogError(Object)
UnityEngine.AddressableAssets.AddressablesImpl:LogException(AsyncOperationHandle, Exception) (at D:\Projects\_BugReports\AddressablesContentUpdate_2\Library\PackageCache\com.unity.addressables@1.18.4\Runtime\AddressablesImpl.cs:253)
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:set_OperationException(Exception) (at D:\Projects\_BugReports\AddressablesContentUpdate_2\Library\PackageCache\com.unity.addressables@1.18.4\Runtime\ResourceManager\AsyncOperations\AsyncOperationBase.cs:306)
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:Complete(Int64, Boolean, Exception, Boolean) (at D:\Projects\_BugReports\AddressablesContentUpdate_2\Library\PackageCache\com.unity.addressables@1.18.4\Runtime\ResourceManager\AsyncOperations\AsyncOperationBase.cs:425)
UnityEngine.ResourceManagement.CompletedOperation`1:Execute() (at D:\Projects\_BugReports\AddressablesContentUpdate_2\Library\PackageCache\com.unity.addressables@1.18.4\Runtime\ResourceManager\ResourceManager.cs:485)
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:InvokeExecute() (at D:\Projects\_BugReports\AddressablesContentUpdate_2\Library\PackageCache\com.unity.addressables@1.18.4\Runtime\ResourceManager\AsyncOperations\AsyncOperationBase.cs:470)
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:Start(ResourceManager, AsyncOperationHandle, DelegateList`1) (at D:\Projects\_BugReports\AddressablesContentUpdate_2\Library\PackageCache\com.unity.addressables@1.18.4\Runtime\ResourceManager\AsyncOperations\AsyncOperationBase.cs:465)
UnityEngine.ResourceManagement.ResourceManager:StartOperation(AsyncOperationBase`1, AsyncOperationHandle) (at D:\Projects\_BugReports\AddressablesContentUpdate_2\Library\PackageCache\com.unity.addressables@1.18.4\Runtime\ResourceManager\ResourceManager.cs:440)
UnityEngine.ResourceManagement.ResourceManager:CreateCompletedOperationInternal(Int64, Boolean, Exception, Boolean) (at D:\Projects\_BugReports\AddressablesContentUpdate_2\Library\PackageCache\com.unity.addressables@1.18.4\Runtime\ResourceManager\ResourceManager.cs:581)
UnityEngine.ResourceManagement.ResourceManager:CreateCompletedOperation(Int64, String) (at D:\Projects\_BugReports\AddressablesContentUpdate_2\Library\PackageCache\com.unity.addressables@1.18.4\Runtime\ResourceManager\ResourceManager.cs:562)
UnityEngine.AddressableAssets.AddressablesImpl:GetDownloadSizeAsync(IEnumerable) (at D:\Projects\_BugReports\AddressablesContentUpdate_2\Library\PackageCache\com.unity.addressables@1.18.4\Runtime\AddressablesImpl.cs:817)
UnityEngine.AddressableAssets.Addressables:GetDownloadSizeAsync(IEnumerable) (at D:\Projects\_BugReports\AddressablesContentUpdate_2\Library\PackageCache\com.unity.addressables@1.18.4\Runtime\Addressables.cs:833)
<CheckForDownload>d__7:MoveNext() (at D:\Projects\_BugReports\AddressablesContentUpdate_2\Assets\Scripts\Loader.cs:114)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)