iOS/xcode: ApplicationMain.hx:399: characters 47-51 : Type not found : Main


I’m working on a project since a few months now, all the requested platforms (HTML5, Windows, Mac, Android) are finally coming together nicely except iOS where I get the following xcode build error:

ApplicationMain.hx:399: characters 47-51 : Type not found : Main

I tried building one of the openfl sample projects (DisplayingABitmap) which was successful, so I dug a little deeper what could cause the issue. It turned out that one of the settings in project.xml caused this error which I’m not sure if it’s OpenFL or more like Haxe related (guess it’s the latter). The XML setting is:

<app main="Main" file="MyApp" path="../dist" unless="debug" />

Now as you can see the path for the distributables/compiled files/assets/etc is one level up in the directory structure for the sole reason of better handling the git versioned files, not including compiled files, bin, haxe, obj etc. in the repo (the project has been set up like this since 6 months, the very beginning of the development).

If I change path="…/dist" to path=“dist” then the aforementioned error no longer pops up, but it kinda messes up my project structure (production and debug builds for multiple platforms).

Not sure if this is a bug, or something I should be aware on my end, if anyone can give me an advice about how to use relative paths in project.xml with successful comiling to iOS would be great.

Note: the rest of the platforms (even Mac native) are perfectly fine with the relative path …/dist

Thank you

I’ve created an image of how the directory structure looks for better understanding the issue.


As a fast workaround, try adding <source path="/path/to/your/project/source" />, that should help it resolve your classes for now, and we can look at fixing relative paths like this in the Xcode builds

1 Like