Relative path does not work on addressables v2.0.8

I just upgrade my project from Unity-2020-3-LTS to Unity-6-0. The Addressables existing build works normally on editor, but not on windows build:

Unable to open archive file: StandaloneWindows64/ProductName/xxx.bundle

Failed to read data for the AssetBundle ‘StandaloneWindows64\ProductName/xxx.bundle’.

RemoteProviderException : Invalid path in AssetBundleProvider: ‘StandaloneWindows64\ProductName/xxx.bundle’.

BuildPath & LoadPath set as: [BuildTarget]/ProductName

You may ask, yes, I have copied the addressables builds from project folder to the windows player folder, as I did on 2020.3, which works fine.

And if I set the LoadPath as Absolute Path like: C:\ProductName, the windows player can load from it.

Thank you in advance.

4 Answers

4
  • Go to Edit → Project Settings → Addressables.
  • Under Build tab, verify the Build Path setting. It’s likely different from StandaloneWindows64/ProductName.
  • Update the Build Path to match the actual location where your Addressable bundles are being built alight motion old version.

Thank you for your reply. There is no Addressables in Project Settings on Unity-6-0. BuildPath & LoadPath set as: [BuildTarget]/ProductName, which works fine on unity-2020-3-LTS. I will try to downgrade Addressables.

–

I tried to downgrade addressable to 1.18.19(used on 2020-3), but the problem still persists.

Then, I used the absolute directory to start the project, found that AssetBundle.LoadFromFileAsync() also encountered the same issue. Because Addressables uses this method to load local assetbundles, I speculate that the problem is not with Addressables, but with Assetbundles.

However, I still don’t know how to solve it.

You may use something like the Process Monitor to see all file activities to know which actual path it tried to read from. I’m not saying you should but your files there, but it may help figuring out why this path was choosen. Be careful as it monitors the whole system and on modern windows, especially when you have a lot of applications open, there’s a lot going on. Start recording just before you try to load them and stop recording right afterwards. Also it has some filtering features.

Thanks a lot!
Unity 6000.0 windows player’s assetbundle system seems use UnityEngine.Application.dataPath as currentFolder, but not the exe Folder.