I’m having trouble loading addressables and asset bundles at runtime on an android device. I build the addressable content using the default build script. Then I build the player apk. I install the apk using “adb install ”, then I copy-paste the addressable files onto the device on the persistentDataPath/Addressables.
That path is then defined inside the addressable profile settings like: Remote.LoadPath:{FileHierarchy.MyAddressablesFolder}/[BuildTarget]
and Local.LoadPath:{FileHierarchy.MyAddressablesFolder}/[BuildTarget]
. Where public static string MyAddressablesFolder => Application.persistentDataPath/Addressables;
. All asset bundles are stored locally on the disk. None are loaded from a remote source.
At runtime, I get an error like this for every single addressable I try to load:
RemoteProviderException : Invalid path in AssetBundleProvider: ‘/storage/emulated/0/Android/data/com.DefaultCompany.Game1/files/Addressables/Android/assets_all.bundle’.
I have had 3 people look compare the “invalid” file path to the actual device, and the files are 100% in the right place. I test this by copy-pasting that file path into adb and doing adb pull
, and I am able to pull that file to my PC, so it 100% points to a valid file. I check the emulated/0/ folder, the sdcard folder, and storage/primary folder, and my addressables exist at all three paths.
Unity is doing its usual thing of just not working and building with the Monte Carlo build method – sometimes it just doesn’t work, and you just keep pressing “Build” until it does. I use this EXACT SAME process on other computers, and SOMETIMES it works, but sometimes it doesn’t. On some machines, it NEVER works. I’ve used this method for months, and then when I changed to a new computer, it no longer works. I have reinstalled Unity.
I’ve tried making the root of the path to my root addressables folder be “/sdcard/”, “/storage/emulated/0/”, and “/storage/primary/”. The paths seem to make no difference. I can always see the files in place, but Unity refuses to acknowledge this fact.
What is something I can do to debug this? I know android uses a virtual file system, am I missing something by using an incorrect root path? I even tried pushing the files using adb, but unity just refuses to acknowledge the files are present. What am I missing here?