- Home /
Splitting Android application and level loading
Hi, I've been trying to use Unity's OBB generation feature ("Split application binary" on Android Player Settings) and had an issue while updating my application.
I have a loading scene and a game scene with many streaming assets. I have only updated some scripts and left the assets untouched. Then I compiled a new APK and uploaded it to the Play Store, and set it to use the previous OBB file.
Now, when I try to run the application, I get this error:
Level 'LevelNameGoesHere' (1) couldn't be loaded because it has not been added to the build settings.
Does any one know why is this happening? It would be really annoying to make my users download the full application each time I make a simple update.
Thanks in advance, Martín.
Hi i'm also getting same issue Level 'LevelName' (1) couldn't be loaded because it has not been added to the build settings. But i added all my scenes to the build settings Did you find any solution?
same problem here. Seems that OBB file is being detected but its contents are not loaded.
Hi $$anonymous$$artín Coll Then how you solve the problem?
Answer by devin8 · Apr 04, 2013 at 06:35 PM
Mine somehow got solved. I read somewhere that mixing Javascript and C# could cause this. I converted all my Javascript code to C# and I have not run into this issue since then.
I had a different requirement that a folder in StreamingAssets be present in APK rather than the OBB file(it was required by native code). So I export the project to Eclipse and manually put the folder there and export the APK from eclipse. The OBB file is built in Temp/StagingArea
what is Strea$$anonymous$$gAssets folder ? is it mandatory ? I don't have that folder anywhere. All my scenes are in Assets/Scenes
Then don't worry about that. Try using only C# code. I think this is what solved my problem.
I have only C# code, so whilst this may be useful for some people, it doesn't solve my problem. Thanks though!
Answer by koushik.s · Apr 05, 2013 at 06:50 AM
Hi Martín Coll I got one solution i drop all my scenes in Resources folder. now its working for me .
Thanks & Regards Koushik.Sarbada
You drop them there, and then how do you load them? Just using Application.LoadLevel? I moved my scenes to the Resources folder and nothing happened :/
Answer by zedarus · Jun 01, 2013 at 04:01 PM
I had the same problem. The only solution I have found is to upload new OBB file for updated APK and then wait at least 30 (or more) minutes while this OBB file will be accessible on server. If I tried to download OBB file right after I uploaded it, the server used previous version of OBB file which, obviously, didn't work with the new APK and I got this error:
Level 'LevelNameGoesHere' (1) couldn't be loaded because it has not been added to the build settings.
I don't like the built in expansion file feature in Unity 4.0. I found that OBB files generated are not reliably consistent with every AP$$anonymous$$ version.
The way I made it work is I converted all my scenes into assetbundles and manually zipped them using 7-zip. Renamed it to OBB and thats it. Works every time and even when you only update AP$$anonymous$$ file. You don't need to upload OBB file everytime and your users won't have to download them again and again.
Thanks for the tip, Devin! Do you know if this method automatically includes all the assets from Resources and Strea$$anonymous$$gAssets folders?
No. By this method you control what you want put in AP$$anonymous$$ and what in OBB. You basically don't use the split application binary option. So all resources and strea$$anonymous$$gassets are included in your apk.
If you want them in your OBB file then create their assetbundles and keep them out of resources and strea$$anonymous$$gassets folders.
Then you access the assetbundles by using the url "jar:file://"+obbPath+"!/bundlename.unity3d". I use GooglePlayDownloader.Get$$anonymous$$ainOBBPath() for getting obbPath.
Yeah, I've tried this approach. But since my game relies too much on assets from resources and strea$$anonymous$$g assets folder (it's image based 2D puzzle), creating assets bundles is a bit pain in the *ss. Automated split works best for me.
Thanks for tip, though!
Answer by atifmahmood29 · Mar 31, 2015 at 10:42 AM
Some devices can't download .obb file. So we need to download.
Please follow following links for detail. http://docs.unity3d.com/Manual/android-OBBsupport.html
http://www.exoa.fr/tutorial-unity-4-apk-splitting-google-play-obb/