- Home /
Missing headers in XCode project generated by Unity
When I build XCode project from Unity and then open it in XCode, I get a couple of errors about missing header files. Each .mm file #imports a corresponding .h file, but there are actually no headers in Project/Classes folder, so the compiler fails to find them. For example: /Users/0xc0dec/dev/Unity_iOS_Test/Build/Test/Classes/AppController.mm:1:9: 'AppController.h' file not found I've been trying various player settings combinations in Unity, but with the same result. I set Target device to "iPhone only", SDK Version to "Device SDK", Target iOS version to 6.0. Other values don't help either. Am I missing some important option?
Installed SDK version is 6.1, Unity version: 4.0.0f7
Something went wrong while Unity was generating Xcode project.Try deleting it and re-building it from Unity. If this does not help - reinstall Unity, delete old xcode project and build new one.
Answer by 0xc0dec · Apr 03, 2013 at 06:02 PM
I ended up installing the latest version of Unity (4.1.2f1), and everything works fine now. It seems like it was an odd Unity bug.
Several months later I finally figured out the exact reason of the problem. It has nothing to do with Unity bugs. I used a program called Clean$$anonymous$$y$$anonymous$$ac, which was cleaning up all headers inside Unity3d bundle (!!!), resulting in those headers not being copied into the build folder of the project. Use that tool carefully, or better don't use at all.