Unable to run game on iOS due to "expected version" error

I just updated Unity and tried running on iOS. I’m able to compile with no issues, but the app immediately crashes because the game manager can’t start up. This appears related to a versioning error. I just now installed Unity, so a reinstall probably won’t work. I’m thinking that this was caused by trying to run this with my old version of Unity (it was Unity 3), had some errors due to version incompatibilities with XCode, updated, and now I get this. Is there some cached data Unity has I need to delete? I noticed that the very first time I tried to build for iOS it took a very long time, and every time afterwards (even if I delete the XCode project) it is very fast.

Here is the error:

2013-01-17 09:23:32.361 skatetest3[1294:907] -> registered mono modules 0xffbfa0
-> applicationDidFinishLaunching()
Mono path[0] = '/var/mobile/Applications/8840CB3A-CBC0-479C-971E-18EA8D06F955/skatetest3.app/Data/Managed'
Invalid serialized file version. File: "/var/mobile/Applications/8840CB3A-CBC0-479C-971E-18EA8D06F955/skatetest3.app/Data/mainData". Expected version: 4.0.0f5. Actual version: 4.0.0f7.
(Filename: /Applications/buildAgent/work/812c4f5049264fad/Runtime/Serialize/SerializedFile.cpp Line: 712)

Failed to read file '/var/mobile/Applications/8840CB3A-CBC0-479C-971E-18EA8D06F955/skatetest3.app/Data/mainData' because it is corrupted.
(Filename: /Applications/buildAgent/work/812c4f5049264fad/Runtime/Serialize/SerializedFile.cpp Line: 432)

PlayerInitEngineNoGraphics settings: Could not preload global game manager #0
   engine intialization failed

And yes I know that this same question was asked on Stack Overflow, but none of that has helped me. Someone there did suggest to try re-importing all my assets into Unity, but holy crap will that be a pain. I would definitely prefer not to.

Hm, turns out when I build for Mac it crashes immediately as well, exiting with error type 1. No other information. If I recall this is due to syntax errors in Mono, although my game runs fine in the player. I think the Unity 4 must have just broken some things. I’ve been getting a number of editor errors that don’t mean anything or have anything to do with my code, actually. So the upgrade is likely broken. I may try to downgrade again to Unity 3.

I think I’d reboot the machine, blow away the xcode project that you have, and empty the trash, so make sure it’s really gone. Then start Unity, do a fresh build, and then load up XCode and do a build, then a run. You probably have some stale data around somewhere, but it’ll be quicker to do what I suggested rather than try and work out what’s not being rebuilt correctly. (Note that you appear to have code built from f5, but data from f7.)

I reinstalled Unity and that seemed to fix it. I believe because I built on both .5f and .7f was causing this issue, despite erasing all projects etc.