Greetings. After muddling through the plethora of other answers on this subject none of their solutions seem to work for me. Here is my situation:
I put an assetbundle into my StreamingAssets folder called bundle.unity3d
I create a build and look in the build folder and notice that my bundle exists at
my.app/Data/Raw/bundle.unity3d
I build the xcode project and upload it to the device.
When the app starts I run a small script on the camera to tell me which files are on the device and their location.
Then I run this code:
www = new WWW(System.Uri.EscapeUriString("file:/" + System.IO.Path.Combine(Application.streamingAssetsPath, "bundle.unity3d")));
I end up with a url something like this:
file://var/mobile/Applications/{GUID}/my.app/Data/Raw/bundle.unity3d
which is completely identical to what the file listing script is telling me (minus the file://)
However this will always return with the error “The requested URL was not found on this server.”
Here is a list of thing’s I’ve tried:
Escaping the Uri string because I’ve heard you MUST do this on iOS.
using System.IO.Path.Combine to create the url.
Making sure there are no typos.
Making sure the file is actually on the device.
Use LoadFromCacheOrDownload (this gives the same “url not found” error).
What I want to know is:
What is the PROPER way to include an asset bundle in your iOS build and then uncompress/load it’s contents at runtime.
Obviously I’m missing something important here. What is it?