title: Build and load Assetbundles in Unity
body: <p>I cannot get Unity Assetbundles working in an iOS build. </p>
  
  <p>In Unity I build the assetbundles:</p>
  
  <pre><code>using UnityEditor;
  
  public class CreateAssetBundles
  {
      [MenuItem("Assets/Build AssetBundles")]
      static void BuildAllAssetBundles()
      {
          BuildPipeline.BuildAssetBundles("Assets/AssetBundles", BuildAssetBundleOptions.None, BuildTarget.iOS);
      }
   }
  </code></pre>
  
  <p>And they work fine in Unity. using them with</p>
  
  <pre><code>AssetBundle bundleLoadRequest = AssetBundle.LoadFromFile("file://" + Application.dataPath + "/AssetBundles/iOS/" + myassetbundlename.ToString());
  </code></pre>
  
  <p>and/or</p>
  
  <pre><code>WWW wwww = WWW.LoadFromCacheOrDownload("file://" + Application.dataPath + "/AssetBundles/iOS/" + myassetbundlename.ToString(), 4); 
  </code></pre>
  
  <p>(Without the "file://" prefix, the bundles won't work in Unity nor Xcode)</p>
  
  <p>I build the project to Xcode and run it in Xcode and receive this error:</p>
  
  <blockquote>
    <p>Unable to open archive file:
    /Users/user/Documents/Workspaces/unityproject/Assets/AssetBundles/iOS/lchairanimations</p>
  </blockquote>
  
  <p>It might be related somehow to setting the correct path, but as I have copied the assetbundle folder afterwards to Xcode project, the problem persists.</p>