Can't get Asset Bundles to load on IOS

I’m currently trying to get IAP working for my game. The goal is to have bonus levels that I can be downloaded from a web server stored on the ios device and then ran whenever. I followed all of the documentation I can find, and When I run it on the device I get the error “can’t be loaded because it was not built with the right version or build target.”

I am building the asset bundle on a Mac with the command "BuildPipeline.BuildAssetBundle(Selection.activeObject, selection, path, BuildAssetBundleOptions.CollectDependencies, BuildTarget.iPhone). I’m then uploading it to a server(it is a Windows server), Im using the command “WWW.LoadFromCacheOrDownload(DLCContentPath);” to download the files when I then run it on IOS i get the error I said above.

I can run the same commands on a PC with the build target set to web player, and everything works fine. All of the paths are correct the files that are getting downloaded are the ones I expect. I get the feeling I’m missing something, anyone have any advice?

I just noticed another error up more in the log tells me that the build target for the bundle is 6, which from what I can tell is web player. I’m not sure how that can be the case since I’m specifying iPhone as the build target.

did you build it while being switched to ios platform in unity ?

Yes the build settings are set to ios

We do what your are trying to do.

This is how we build

					bool result = BuildPipeline.BuildAssetBundle(	Selection.activeObject,
									                               	Selection.objects,
									                               	assetBundlePath,
									                               	BuildAssetBundleOptions.CollectDependencies|BuildAssetBundleOptions.CompleteAssets,
									                               	BuildTarget.iPhone
									                               	);

And this is how we download

WWW.LoadFromCacheOrDownload(url,version);

This has worked for us for a year or so now.

It turned out to be a caching problem. I had to delete the project completely from the ipad(I’m assuming updating the version would have also fixed it), one of the first version I had put up must have accidentally been a webplayer build target.