Using AssetBundles as IAP Crashing

Hi, we’re creating an iOS game and want to create IAP assetbundles that the user can buy and then download from our servers.

Basically when the user has bought the IAP and loads up the “Level Select” Scene for the DLC levels, we use WWW.LoadFromCacheOrDownload(“http://where.we.are.hosting/our.assetbundle”, 1); to download or load from cache the 60 levels we’ve created for the build.

Then we call Application.LoadLevelAsync(“NameOfDLCLevelSelect”); to start the first scene. Now this works if I build from the Editor into XCode and then from XCode onto my iOS Device. It still works if I build from XCode again.

However, if I make changes in the editor and then rebuild from editor → xCode-> device and attempt to call WWW.LoadFromCacheOrDownload(“http://where.we.are.hosting/our.assetbundle”, 1); again, xCode says my level, “NameOfDLCLevelSelect” does not exist in the build settings. Then the app crashes with a bad-access exception.

If I delete the app from the device and rebuild from XCode, then it works.

I’m concerned that this is what would happen to a user if they were to update their app from the iTunes Store. Arguably, the same thing happens if you download a new version of the app and retain all the app data, right?

I’m also getting this error in xCode when I play the game on the device plugged in:

The file ‘/var/mobile/Applications/ECAFEB51-2EC7-44F0-9831-D3E4B7BFBFC5/Documents/UnityCache/Shared/925bddb855cb509582025845b0ec2821b27eadd0/BuildPlayer-HalloweenSelectOptimized’ is corrupted! Remove it and launch unity again!
[Position out of bounds!]

Sure you mean asset bundles, not streaming scenes?
Cause asset bundles can not transport scenes, only distinct assets (prefabs, materials, meshes, sounds).

Also keep in mind that you must provide functionality straight in the application that works after installation or apple will reject it if the app only acts as download proxy.