Search Unity

Invalid path in AssetBundleProvider on Android device

Discussion in 'Localization Tools' started by lucianvartolomei, Jan 30, 2021.

  1. lucianvartolomei

    lucianvartolomei

    Joined:
    Oct 22, 2018
    Posts:
    23
    Hi

    I made a simple test using the localization package. In the editor it works fine, but when running the build on an Android device I get this error (among others), but i guess this is the main issue:

    Exception encountered in operation Resource<IAssetBundleResource>(Android\localization-locales_assets_all.bundle), status = Failed, result: : Invalid path in AssetBundleProvider: 'Library/com.unity.addressables/aa/Android/Android\localization-locales_assets_all.bundle'.

    I built the localization addressables from Groups/Build/New Build/Default Build Script.

    Why would it try to load the addressables on an android device from the 'Library/com.unity.addressables' folder?

    I'm using Unity 2020.2.2, localization package 0.10 and addressables package 1.16.16

    Thanks
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    Did you change any of the addressable settings? There is a bug in addressables. If you open the addressables group window, select the locales group and change the naming from filename to filename+hash, does that fix it?
     
    tuccci likes this.
  3. Xsodiaz

    Xsodiaz

    Joined:
    Jul 9, 2019
    Posts:
    16
    I've got the same error but I didn't quite catch what you mean.
    Here's a look of my Addressables groups Window
    upload_2021-1-31_0-22-42.png
     
  4. Xsodiaz

    Xsodiaz

    Joined:
    Jul 9, 2019
    Posts:
    16
    Mysteriously, I've check your post here :
    https://forum.unity.com/threads/loc...patibility-is-nightmare.1037479/#post-6767326

    And I immediately tried the following (actually I've tried many things while debugging before trying the following) :
    upload_2021-1-31_2-42-58.png
    I navigated all these files, and whenever I found an asset with the possibility to change its Bundle Naming, I changed it to "Append Hash to Filename"
    upload_2021-1-31_2-45-20.png
    Then I built again the adressables, and it magically worked.

    The big question is how can I do that for iOS (I use cloud build) :(
     
  5. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    You can change the setting in the editor and save the project, then build with those changes in the cloud, they are the same for all platforms.
     
  6. Xsodiaz

    Xsodiaz

    Joined:
    Jul 9, 2019
    Posts:
    16
    Actually it didn't work, and I get some kind of error :
    iPhonePlayer(xxxxxx):56000 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=xxxxxxxxxxxxxx]]
     
  7. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    Thats strange. Do you have stripping enabled? Try turning it off
     
  8. lucianvartolomei

    lucianvartolomei

    Joined:
    Oct 22, 2018
    Posts:
    23
    Hi, yes, it worked after i did that change.
    Will test again with the original settings after new updates to the addressables package appear.

    Thanks
     
    karl_jones likes this.
  9. Xsodiaz

    Xsodiaz

    Joined:
    Jul 9, 2019
    Posts:
    16
    I can't turn it off, I can only set it to low "which didn't solve the problem anyways"
    The problem is solved by turning on the "Build adressables" feature on the cloud itself, I had no clue that it existed, I just checked randomly while surfing the cloud build configs, and now it's working. Thanks
    "Only one little issue, I don't know if I have to create a new thread for it." How can I ensure my game text to change before scene starts. (The localization doesn't actually take place until the game fully loads which looks crappy)
    And thanks for your assistance
     
  10. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    We added a sample that shows how to wait for it to load. Take a look at the samples in the package manager
     
    Last edited: Feb 1, 2021
  11. Finijumper

    Finijumper

    Joined:
    Jul 12, 2016
    Posts:
    79
    Is the bug in the adressables solved? I think it's really annoying having to change that setting for all the Addressables.
     
  12. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    It's fixed and should be in the next addressable release, probably next week.
     
  13. mrawlik

    mrawlik

    Joined:
    May 27, 2020
    Posts:
    1
    Hi! Should it be fixed in Addressables 1.17.5-preview?

    I have what seems to be the same problem on Windows with Windows target. Unity 2019.4.14f, Localization 0.10.0-preview, Addressables 1.16.16 and I tried to upgrade to 1.17.5-preview, hoping that is the release you are referring to.
     
  14. waitix

    waitix

    Joined:
    Sep 29, 2016
    Posts:
    8
    Broken in addressables 1.16.16, works in 1.17.5-preview and 1.16.15.
     
  15. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    I think this is the append hash to name issue. It should be fixed in the next addressable release.
     
  16. fraeri

    fraeri

    Joined:
    Nov 8, 2018
    Posts:
    64
    Hi All,
    I need to ask for help with the same error. In Editor everything is fine.
    But these are errors I get, when running my Project in iOS:

    Code (CSharp):
    1. MissingMethodException: Default constructor not found for type UnityEngine.ResourceManagement.AsyncOperations.ProviderOperation`1[[UnityEngine.AddressableAssets.Initialization.ResourceManagerRuntimeData, Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]
    2.   at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) [0x00000] in <00000000000000000000000000000000>:0
    3.   at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in <00000000000000000000000000000000>:0
    4.   at UnityEngine.ResourceManagement.Util.LRUCacheAllocationStrategy.New (System.Type type, System.Int32 typeHash) [0x00000] in <00000000000000000000000000000000>:0
    5.   at UnityEngine.ResourceManagement.ResourceManager.CreateOperation[T] (System.Type actualType, System.Int32 typeHash, System.Int32 operationHash, System.Action`1[T] onDestroyAction) [0x00000] in <00000000000000000000000000000000>:0
    6.   at UnityEngine.ResourceManagement.ResourceManager.ProvideResource (UnityEngine.ResourceManagement.ResourceLocations.IResourceLocation location, System.Type desiredType, System.Boolean releaseDependenciesOnFailure) [0x00000] in <00000000000000000000000000000000>:0
    7.   at UnityEngine.ResourceManagement.ResourceManager.ProvideResource[TObject] (UnityEngine.ResourceManagement.ResourceLocations.IResourceLocation location) [0x00000] in <00000000000000000000000000000000>:0
    8.   at UnityEngine.AddressableAssets.Initialization.InitializationOperation.CreateInitializationOperation (UnityEngine.AddressableAssets.AddressablesImpl aa, System.String playerSettingsLocation, System.String providerSuffix) [0x00000] in <00000000000000000000000000000000>:0
    9.   at UnityEngine.AddressableAssets.AddressablesImpl.InitializeAsync (System.String runtimeDataPath, System.String providerSuffix, System.Boolean autoReleaseHandle) [0x00000] in <00000000000000000000000000000000>:0
    10.   at UnityEngine.AddressableAssets.AddressablesImpl.get_ChainOperation () [0x00000] in <00000000000000000000000000000000>:0
    11.   at UnityEngine.AddressableAssets.AddressablesImpl.LoadAssetsAsync[TObject] (System.Object key, System.Action`1[T] callback, System.Boolean releaseDependenciesOnFailure) [0x00000] in <00000000000000000000000000000000>:0
    12.   at UnityEngine.AddressableAssets.Addressables.LoadAssetsAsync[TObject] (System.Object key, System.Action`1[T] callback) [0x00000] in <00000000000000000000000000000000>:0
    13.   at UnityEngine.Localization.AddressablesInterface.LoadAssetsWithLabelInternal[TObject] (System.String label, System.Action`1[T] callback) [0x00000] in <00000000000000000000000000000000>:0
    14.   at UnityEngine.Localization.AddressablesInterface.LoadAssetsWithLabel[TObject] (System.String label, System.Action`1[T] callback) [0x00000] in <00000000000000000000000000000000>:0
    15.   at UnityEngine.Localization.Settings.LocalesProvider.get_PreloadOperation () [0x00000] in <00000000000000000000000000000000>:0
    16.   at UnityEngine.Localization.Settings.LocalizationSettings.GetSelectedLocaleAsync () [0x00000] in <00000000000000000000000000000000>:0
    17.   at UnityEngine.Localization.Settings.LocalizedDatabase`2[TTable,TEntry].GetTableAsync (UnityEngine.Localization.Tables.TableReference tableReference, UnityEngine.Localization.Locale locale) [0x00000] in <00000000000000000000000000000000>:0
    18.   at 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) [0x00000] in <00000000000000000000000000000000>:0
    19.   at UnityEngine.Localization.LocalizedString.HandleLocaleChange (UnityEngine.Localization.Locale _) [0x00000] in <00000000000000000000000000000000>:0
    20.   at UnityEngine.Localization.LocalizedString.add_StringChanged (UnityEngine.Localization.LocalizedString+ChangeHandler value) [0x00000] in <00000000000000000000000000000000>:0
    21. (Filename: currently not available on il2cpp Line: -1)
    I checked all the addressables regarding its bundle namings.
    Also changed the Adressable Versions multiple times in different versions.

    This Is the Code I Use for a languages dropdown:
    Code (CSharp):
    1.  
    2. IEnumerator InitializeLocales()
    3. {
    4.         //https://forum.unity.com/threads/invalid-path-in-assetbundleprovider-on-android-device.1048286/
    5.  
    6.         yield return LocalizationSettings.InitializationOperation;
    7.  
    8.         while (!LocalizationSettings.InitializationOperation.IsDone)
    9.         {
    10.             yield return true;
    11.         }
    12.  
    13.         // Create an option in the dropdown for each Locale
    14.         var options = new List<string>();
    15.         int selectedOption = 0;
    16.         var locales = LocalizationSettings.AvailableLocales.Locales;
    17.         for (int i = 0; i < locales.Count; ++i)
    18.         {
    19.             var locale = locales[i];
    20.             if (LocalizationSettings.SelectedLocale == locale)
    21.                 selectedOption = i;
    22.  
    23.             var displayName = locales[i].Identifier.CultureInfo != null ? locales[i].Identifier.CultureInfo.NativeName : locales[i].ToString();
    24.             options.Add(displayName);
    25.         }
    26. }
    27.  
    Thanks a lot,
    Eric
     
  17. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    Hi this is an addressable bug. Are you able to file a bug report? I have not been able to reproduce this issue myself yet.

    It may be worth trying a few different versions of addressables. 16.5 seems to be good
     
  18. fraeri

    fraeri

    Joined:
    Nov 8, 2018
    Posts:
    64
    I tried 1.16.16, 1.16.15 and 1.17.5 with no luck. Do I need to do something else than update or downdate the Adressables?
    Although I see your signature with the "Where is my log file"-Link. What bug report file do you mean exactly?

    Thanks!

    EDIT: I really don't know exactly what I did, but basically I deleted all Addressables, Re-Installed them, checked the bundle naming, build them and then needed to recreated all localization work (which was not a lot at this stage,... later would be painful).

    I hope this one gets resolved soon! I don't trust it at all ,...

    Cheers
     
    Last edited: Feb 24, 2021
  19. oozturkplus

    oozturkplus

    Joined:
    Dec 3, 2020
    Posts:
    16
    Hi,

    I received below error for my IOS build.

    Exception encountered in operation Resource<IAssetBundleResource>(iOS\localization-locales_assets_all.bundle), status=Failed, result= : Invalid path in AssetBundleProvider: 'Library/com.unity.addressables/aa/iOS/iOS\localization-locales_assets_all.bundle'.

    Can you help me?
     
  20. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    Did you build the addressable assets?
    Have you changed the build path property for the Locale group?
    Have you tried updating to the latest version of Addressables?

    upload_2021-5-24_13-22-19.png
     
  21. oozturkplus

    oozturkplus

    Joined:
    Dec 3, 2020
    Posts:
    16
    Thanks solved.
     
    karl_jones likes this.
  22. oozturkplus

    oozturkplus

    Joined:
    Dec 3, 2020
    Posts:
    16
    Hi,

    I received below error for android build.

    E/Unity(15030): 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]]
     
  23. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    What version of Unity, localization and addressables are you using? This looks like an old bug. Can you try updating to the latest versions of all of the above ;)
     
  24. oozturkplus

    oozturkplus

    Joined:
    Dec 3, 2020
    Posts:
    16
    I tried to migrate from 2019.4.19f1 to 2021.1.7.
    When I try to open my project with Unity new version it crashed.
    I tried to Report Bug but also Report Bug crashed.
    upload_2021-5-27_6-2-45.png


    However I opened my project with new Unity there is a console log to notify me about that
    "use Reimport" but when I try to do Reimport it crashes again.
    I'm confused. Can you help me?
     
  25. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    Sorry I didn't mean the alpha version. Try the latest 2019.4, that's what I meant.
     
  26. oozturkplus

    oozturkplus

    Joined:
    Dec 3, 2020
    Posts:
    16
    Hi Karl,

    I tried to open my project with 2019.4.26f1 version but that version couldn't open my project successfully.
    I reported bug successfully.
    Is 2019.4.19f1 version too old to run project healty?
     
  27. oozturkplus

    oozturkplus

    Joined:
    Dec 3, 2020
    Posts:
    16
    Hi Karl,

    I opened my project successfully with version 2019.4.26f1 .
    Now I'm receiving a difference error "GLSL link error: The number of vertex shader storage blocks (1) is greater than the maximum number allowed (0)."

    Can you help me?
     
  28. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    I'm afraid my shader knowledge is quite limited so there's not much I can offer regarding that error.
    I can see previous discussions regarding it and it seems to be due to an android limitation.
    you usually cannot use StructuredBuffer in vertex shaders on Android.
    The gl spec says the minimum supported ssbo count in vs is zero.
     
  29. noobogami

    noobogami

    Joined:
    Jul 24, 2021
    Posts:
    44
    I had problem with addressable 1.16 and bundle naming so I updated to 1.19 and it worked but now I'm getting this error for local group that their bundle naming are on "File Name":

    RemoteProviderException : Invalid path in AssetBundleProvider: ''.

    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.AddressableAssets.AddressablesImpl:LogException(AsyncOperationHandle, Exception)
    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.ResourceManagement.AsyncOperations.ProviderOperation`1:ProviderCompleted(T, Boolean, Exception)
    UnityEngine.ResourceManagement.ResourceProviders.ProvideHandle:Complete(T, Boolean, Exception)
    UnityEngine.ResourceManagement.ResourceProviders.AssetBundleResource:BeginOperation()
    UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider:Provide(ProvideHandle)
    UnityEngine.ResourceManagement.AsyncOperations.ProviderOperation`1:Execute()
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:InvokeExecute()
    UnityEngine.ResourceManagement.A


    remote assets seems work fine and problem is with some of local asset (not all of them)
     
  30. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    Can you show a screenshot of the addressable group settings?
     
  31. noobogami

    noobogami

    Joined:
    Jul 24, 2021
    Posts:
    44
    upload_2021-9-20_14-16-59.png
     
  32. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    I cant see anything wrong there. Can you take a screenshot of the addressable profiles? Addressable group window, profiles menu item. Like this
     

    Attached Files:

  33. noobogami

    noobogami

    Joined:
    Jul 24, 2021
    Posts:
    44
    thanks for response, here's screenshots:
    upload_2021-9-21_12-26-39.png upload_2021-9-21_12-28-6.png
     
    LeeSeoulYeul likes this.
  34. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    You dont seem to have a build target Untitled.jpg

    Try adding the default value in:
    [UnityEditor.EditorUserBuildSettings.activeBuildTarget]
     
  35. noobogami

    noobogami

    Joined:
    Jul 24, 2021
    Posts:
    44
    I dont' use that parameter but i'll set it and test it again and will announce result. thanks for your time :)
     
    karl_jones likes this.
  36. noobogami

    noobogami

    Joined:
    Jul 24, 2021
    Posts:
    44
    I tried it and works randomly! in one build it's fine but in one build it's totally messed up!
    some assets are OK but some are not.
    can't find the reason.
     
  37. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    Strange. That may be worth a bug report.
     
  38. noobogami

    noobogami

    Joined:
    Jul 24, 2021
    Posts:
    44
    this is too random! I cloned project twice in a single machine and in one I'm seeing this error but in another one not.
    bug report won't do anything because I can't describe a reproduce condition.
    now I'm getting this error for some remote assets.
     
    Last edited: Oct 9, 2021
  39. noobogami

    noobogami

    Joined:
    Jul 24, 2021
    Posts:
    44
    UPDATE:
    when I perform new addressable build it seems working and after updating previous build and putting new catalogue on server some assets won't download anymore with this error:
    RemoteProviderException : Invalid path in AssetBundleProvider: ''.

    and it's always that specific bundles.
     
    Last edited: Oct 9, 2021
  40. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    Sounds like the build path could be wrong. You could try deleting the addressables directory and then regenerating it using the localization addressables Analyzers.
     
  41. noobogami

    noobogami

    Joined:
    Jul 24, 2021
    Posts:
    44
    "com.addressable.unity" folder in library directory?
     
  42. gamedev_co

    gamedev_co

    Joined:
    Apr 16, 2021
    Posts:
    7
    I am facing the same issue and removing "com.unity.addressable" folder in Library folder didn't solve the problem.
    When I compare the catalog hashes of default build & update, only the following stuff looks like changed :

    "m_BucketDataString"
    "m_EntryDataString"
    "m_ExtraDataString"
    the content that I changed in "m_InternalIds" array
    "m_KeyDataString"

    In the stack trace, it says :

    RemoteProviderException : Invalid path in AssetBundleProvider: ''
     
  43. BitingCold

    BitingCold

    Joined:
    Apr 9, 2019
    Posts:
    4
    For anyone struggling - the bug is still there, so try this setting first.. Android build was trying to access ServerData folder (not the remote load path which it was set to load assets from) before I changed the setting to filename+hash.
     
  44. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    That bug is fixed. There is an issue when updating causing the build and load paths to become corrupted. Addressables made some serialization changes. There will be a fix coming but for now it should be possible to fix doing this: https://forum.unity.com/threads/err...th-localization-package.1182001/#post-7566754
     
  45. BitingCold

    BitingCold

    Joined:
    Apr 9, 2019
    Posts:
    4
    Thanks! I'll try to switch back to filename only setting and try the workaround you provided
     
    karl_jones likes this.