title: Unity - Loading asset bundles - File can't be loaded because it is not compatible with this platform
body: <p>I'm working on Unity app that loads asset bundles from my htdocs, one that is to run on an iPhone.</p>
  
  <p>While the content acquisition works (afaik), the loading stops about halfway and Xcode spits out the following error:</p>
  
  <pre><code>Unloading 3 Unused Serialized files (Serialized files now loaded: 0)
  UnloadTime: 13.037000 ms
  
  Unloading 50 unused Assets to reduce memory usage. Loaded Objects now: 733.
  Total: 10.006415 ms (FindLiveObjects: 0.065750 ms CreateObjectMapping: 0.033250 ms MarkObjects: 0.951208 ms  DeleteObjects: 8.955166 ms)
  
  2016-10-26 18:34:58.882 CookieJarApp[6245:1953469] You are using download over http. Currently unity adds NSAllowsArbitraryLoads to Info.plist to simplify transition, but it will be removed soon. Please consider updating to https.
  Asset bundle [ios_cookie_prefabs] loaded.
  &lt;CoLoadAssetBundle&gt;d__20:MoveNext()
  
  (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
  
  The file can not be loaded because it was created for another build target that is not compatible with this platform.
  Please make sure to build AssetBundles using the build target platform that it is used by.
  File's Build target is: 13
  
  &lt;CoLoadAssetBundle&gt;d__20:MoveNext()
  
  [ line 907] 
  (Filename:  Line: 907)
  
  The AssetBundle 'http://192.168.1.241:80/CookieJarApp_test/ios_cookie_prefabs' can't be loaded because it was not built with the right version or build target.
  &lt;CoLoadAssetBundle&gt;d__20:MoveNext()
  
  [ line 406] 
  (Filename:  Line: 406)
  
  NullReferenceException: A null value was found where an object instance was required.
    at AssetBundleController.GetGameObject (System.String bundleID, System.String objectName) [0x00000] in &lt;filename unknown&gt;:0 
    at AssetBundleController.UnloadAll () [0x00000] in &lt;filename unknown&gt;:0 
    at Loader+&lt;LoadPrefabs&gt;c__AnonStorey22.&lt;&gt;m__15 (UnityEngine.AssetBundle bundle) [0x00000] in &lt;filename unknown&gt;:0 
    at AssetBundleController+&lt;CoLoadAssetBundle&gt;d__20.MoveNext () [0x00000] in &lt;filename unknown&gt;:0 
  
  (Filename: currently not available on il2cpp Line: -1)
  </code></pre>
  
  <p>However, I built the prefab (another game in itself) with iOS platform selected in Build Settings.</p>
  
  <p>I've been told it's different for asset bundles, is there anything else I can try?</p>
  
  <p>Here's the <code>CoLoadAssetBundle</code> function:</p>
  
  <pre><code>// Start a download of the given URL
          WWW www = new WWW(url);
  
          while (!www.isDone)
          {
              Debug.Log("[" + bundleId + "] Progress:" + www.progress * 100f + "%");
              yield return null;
          }
  
          if (string.IsNullOrEmpty(www.error))
          {
              Debug.Log("Asset bundle [" + bundleId + "] loaded.");
              m_assetBundleList.Add(new AssetBundleStruct(bundleId, www.assetBundle));
          }
          else
          {
              Debug.Log("Asset bundle [" + bundleId + "] not loaded!\n[" + www.error + "]");
          }
  
          www.Dispose();
  </code></pre>