Unity Game level 0 is corrupted HELP!

So my game works in editor but when i build it say one of my levels is corrupted? I’m not sure how to fix this. please help all help is appreciated
this is what i get in the development log:
The file ‘/Users/joshua/Documents/Fps/Test_01.app/Contents/Data/level0’ is corrupted! remove it and launch unity again! [position out of bounds! 16068 > 16064]

The file ‘/Users/joshua/Documents/Fps/Test_01.app/Contents/Data/level0’ is corrupted! remove it and launch unity again! [position out of bounds! 16068 > 16064]

The file ‘/Users/joshua/Documents/Fps/Test_01.app/Contents/Data/level0’ is corrupted! remove it and launch unity again! [position out of bounds! 16068 > 16064]

You may have used

#if UNITY_EDITOR

to conditionally remove a variable by the Preprocessor.

This was one cause anyway…

http://forum.unity3d.com/threads/level-is-corrupt.78201/

http://forum.unity3d.com/threads/problem-with-build.117625/link text

http://forum.unity3d.com/threads/fatal-content-error-web-player-our-fix.125224/#post-842842

That usually means that the level data was built using a different version of Unity to the run time. Maybe create a totally new build and see if that has the same problem.

This bug might be related. It exists in the latest version (today 4.5.1f3) and for what I could tell it exists in previous versions as well.

This is a repro case:

A generic class with a generic array
using UnityEngine;

public class GenericBaseClass<T> : MonoBehaviour {
    [SerializeField]
    private T[] objects;
}

A derived empty class (might not even be necessary)

public class DerivedClass : GenericBaseClass<DerivedClass> {}

Now create any object and attach the DerivedClass component to it. Compile your build with debug enabled and run it and the error will show.

The current temporary fix I found was to use a Object[] or GameObject[] instead of T[] (losing type safety) and use GetComponent() (and casting to T) to retrieve the T (losing some performance).

This issue does not seem to affect the webplayer (at least my repro case doesn’t affect the webplayer, but I didn’t run extensive tests).

In my case, the build would work if I started a new blank scene. So I copied the contents of my scene that was leading to the corrupted level0 error, and pasted them into my new blank scene. It worked fine after that.