Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug RuntimeData is null error when using Localization on Android

Discussion in 'Localization Tools' started by Bersaelor, Dec 4, 2020.

  1. Bersaelor

    Bersaelor

    Joined:
    Oct 8, 2016
    Posts:
    110
    Hello there, I wanted to try out the new Localization Package.

    It works fine in the Editor, but when I build & run on Android I get the error below.

    If I comment out the 3 first lines, and uncomment the commented lines below, it works, so the issue has to be connected with the Localization:

    Code (CSharp):
    1.  
    2.     private IEnumerator InitLocale() {
    3.         yield return LocalizationSettings.InitializationOperation;
    4.         var currentLocale = LocalizationSettings.SelectedLocale;
    5.         LoadLanguage(currentLocale.Identifier.Code);
    6.         // yield return new WaitForSeconds(2);
    7.         // LoadLanguage("en");          
    8.         status = ManagerStatus.Started;
    Also, I found this thread but rebuilding the Addressables via Window -> Asset Management -> Addressables -> Groups -> Build did not change anything...

    Error:


    2020/12/04 21:17:37.999 18783 18811 Error Unity RuntimeData is null. Please ensure you have built the correct Player Content.
    2020/12/04 21:17:37.999 18783 18811 Error Unity UnityEngine.StackTraceUtility:ExtractStackTrace () (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/StackTrace.cs:37)
    2020/12/04 21:17:37.999 18783 18811 Error Unity UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    2020/12/04 21:17:37.999 18783 18811 Error Unity UnityEngine.Logger:Log (UnityEngine.LogType,object)
    2020/12/04 21:17:37.999 18783 18811 Error Unity UnityEngine.Debug:LogError (object)
    2020/12/04 21:17:37.999 18783 18811 Error Unity UnityEngine.AddressableAssets.AddressablesImpl:LogError (string) (at /Users/konrad/Source/LooCAR_Unity/Library/PackageCache/com.unity.addressables@1.16.6/Runtime/AddressablesImpl.cs:232)
    2020/12/04 21:17:37.999 18783 18811 Error Unity UnityEngine.AddressableAssets.Addressables:LogError (string) (at /Users/konrad/Source/LooCAR_Unity/Library/PackageCache/com.unity.addressables@1.16.6/Runtime/Addressables.cs:301)
    2020/12/04 21:17:37.999 18783 18811 Error Unity UnityEngine.ResourceManagement.AsyncOperations.InitalizationObjectsOperation:Execute () (at /Users/konrad/Source/LooCAR_Unity/Library/PackageCache/com.unity.addressables@1.16.6/Runtime/Initialization/InitializationObjectsOperation.cs:61)
    2020/12/04 21:17:37.999 18783 18811 Error Unity UnityEngine.ResourceMa
    2020/12/04 21:17:38.009 18783 18811 Warn Unity Addressables - Unable to load runtime data at location UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1[[UnityEngine.AddressableAssets.Initialization.ResourceManagerRuntimeData, Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]].
    2020/12/04 21:17:38.009 18783 18811 Warn Unity UnityEngine.StackTraceUtility:ExtractStackTrace () (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/StackTrace.cs:37)
    2020/12/04 21:17:38.009 18783 18811 Warn Unity UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    2020/12/04 21:17:38.009 18783 18811 Warn Unity UnityEngine.Logger:LogFormat (UnityEngine.LogType,string,object[])
    2020/12/04 21:17:38.009 18783 18811 Warn Unity UnityEngine.Debug:LogWarningFormat (string,object[])
    2020/12/04 21:17:38.009 18783 18811 Warn Unity UnityEngine.AddressableAssets.AddressablesImpl:LogWarningFormat (string,object[]) (at /Users/konrad/Source/LooCAR_Unity/Library/PackageCache/com.unity.addressables@1.16.6/Runtime/AddressablesImpl.cs:227)
    2020/12/04 21:17:38.009 18783 18811 Warn Unity UnityEngine.AddressableAssets.Addressables:LogWarningFormat (string,object[]) (at /Users/konrad/Source/LooCAR_Unity/Library/PackageCache/com.unity.addressables@1.16.6/Runtime/Addressables.cs:29
    2020/12/04 21:17:38.026 18783 18811 Error Unity Exception encountered in operation InitializationOperation, status=Failed, result= : Addressables - Unable to load runtime data at location UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1[[UnityEngine.AddressableAssets.Initialization.ResourceManagerRuntimeData, Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]].
    2020/12/04 21:17:38.026 18783 18811 Error Unity UnityEngine.StackTraceUtility:ExtractStackTrace () (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/StackTrace.cs:37)
    2020/12/04 21:17:38.026 18783 18811 Error Unity UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    2020/12/04 21:17:38.026 18783 18811 Error Unity UnityEngine.Logger:LogFormat (UnityEngine.LogType,string,object[])
    2020/12/04 21:17:38.026 18783 18811 Error Unity UnityEngine.Debug:LogErrorFormat (string,object[])
    2020/12/04 21:17:38.026 18783 18811 Error Unity UnityEngine.AddressableAssets.AddressablesImpl:LogException (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle,System.Exception) (at /Users/konrad/Source/LooCAR_Unity/Library/PackageCache/com.unity.addressables@1.16.6/Runtime/AddressablesImpl.cs:238)
    2020/12/04 21:17:38.026 18783 18811 Error Unity UnityEngine.ResourceManagement.AsyncOperation
    2020/12/04 21:17:38.047 18783 18811 Error Unity Exception encountered in operation CompletedOperation, status=Failed, result= : Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=Locale, Type=UnityEngine.Localization.Locale
    2020/12/04 21:17:38.047 18783 18811 Error Unity UnityEngine.StackTraceUtility:ExtractStackTrace () (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/StackTrace.cs:37)
    2020/12/04 21:17:38.047 18783 18811 Error Unity UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    2020/12/04 21:17:38.047 18783 18811 Error Unity UnityEngine.Logger:LogFormat (UnityEngine.LogType,string,object[])
    2020/12/04 21:17:38.047 18783 18811 Error Unity UnityEngine.Debug:LogErrorFormat (string,object[])


    I am using Localization 0.9.0 and Unitt 2020.2.0b14 .
     
  2. Bersaelor

    Bersaelor

    Joined:
    Oct 8, 2016
    Posts:
    110
    I guess this line below the above error might also be relevant:


    Code (CSharp):
    1. 2020/12/04 21:22:47.977 21041 21094 Error Unity Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=Locale, Type=UnityEngine.Localization.Locale
    2.  
     
  3. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,228
    Error Unity RuntimeData is null.

    Hey. I think this is an error in the Addressables package, I encountered it myself the other day. Can you try updating the package to the latest version? You may need to add it in the package manager. Updating fixed it for me.
     
    Bersaelor likes this.
  4. Bersaelor

    Bersaelor

    Joined:
    Oct 8, 2016
    Posts:
    110
    Wow, thank you for the quick answer!

    The package was on 1.16.6, I upgraded to 1.16.15, after which the same error still occured, But after another round of `Window -> Asset Management -> Addressables -> Groups -> Build -> New Default build` it works. :)
     
    karl_jones likes this.
  5. atulvi

    atulvi

    Joined:
    Oct 28, 2020
    Posts:
    35
    Error Unity RuntimeData is null.

    Short Answer => [Clear old build for addressable asset and create new build for addressable asset]

    ==> Install Addressable asset from Package Manager(stable or verified version). or upgrade addressable asset.
    ==> BackUp Assets > ServerData > [BuildTarget](Ex. Android) Rename the Android folder to OldAndroidData as Backup.
    ==> Open Addressable Groups tab from Unity Window >Asset Management > Addressables > Groups
    ==> Click on Build > New Build > Default Build Script . when generate new Data from Assets > ServerData >[BuildTarget]
    ==> Copy the all asset files(.bundle,.json,.hash extensions files) into your favorite database like AWS S3 bucket. all files as make public.(if files as not public require authentication or authorization required or http/1.1 403 forbidden error)
     
    Bersaelor and karl_jones like this.