Why do i get error that level is not in build settings when i can see that it is in multiple ways?

Specifically I get the error message:

Level '' (1) couldn't be loaded because it has not been added to the build settings. To add a level to the build settings use the menu File->Build Settings...

This appears in the debug output in Xcode /only/ for the iOS build of our game. Every other platform build does not have this problem and successfully loads the level. I can see the text data in ProjectSettings.asset is correct and the ‘Build settings’ UI also has a level number 1 which is the correct level.

Aside from the error not occurring on other platforms the content of the scene in question are loaded and used correctly on these platforms.

I have cleaned out the library and temporary files to the best of my ability… does anyone have any suggestions as to what I might have configured wrongly to achieve this? There is no indication of a problem during the build process - only when running on a device.

Annoyingly - as an aside - the builds work okay in other respects, minus the functonality included in that scene, except on the original iPad mini which hard crashes about the time I expect to see this error in a debug build.

This smells of a bug - at the least because everything works correctly on all other platforms I can test on. The contents of ProjectSettings.asset should be respected regardless as to any temporary data, caches or bad defaults…

EDIT: I have now tested this on a clean machine and am able to reproduce the problem. I am raising a bug for this - in the meantime I will try using the string form of the function as workaround.

EDIT: I have now tried the string version of the function and instead I get this ‘complimentary’ error message - but it also works correctly on all other platforms:

Level 'bg_music_additive' (-1) couldn't be loaded because it has not been added to the build settings. To add a level to the build settings use the menu File->Build Settings...

EDIT: A crucial omission in the original question is that I am using LoadLevelAdditiveAsync. It turns out that LoadLevelAdditive works fine - if not asynchronously.

EDIT: Bug raised - Case 597310. I have suggested a simple mitigation of making the error message accurate - something like: “LoadLevelAdditiveAsync does not work correctly for iOS - use LoadLevelAdditive instead” so this becomes trivial to identify and workaround until a real fix is provided (if ever).

EDIT: Another bug is that LoadLevelAdditive only works under iOS with the indices and not the scene name (which works under Android, Windows Desktop, Mac OS X)

I had similar problem. My solution is to check EditorBuildSettings.asset and fix mistakes in it.
Some times unity put wrong characters.

For example my scene has name “Church”.
Unity changed the name in the file to “\u0421hurch”, then can’t find scene with name “Church”, because it isn’t exists.

I just faced this issues and the way I used to fix the problem is to clear the Build Settings’ scenes and add them back in.

There seems to be an issue where moving the scenes files in a different newly created folder might not be updated in the Build Setting internal paths. In my case, I had to reorganize the folder containing the project’s scenes as it was becoming a real mess. After, I started getting error from the Build Index where, for example, it tells me that Build Index (1) is missing and I have to add it into the Build Setting (while I had over 30 scenes in the build setting)

Removing (select & delete) then add it back fixed the issue.