[Solved]Ios build fails, Class not found: Main


I have a simple project that seems to build from openfl using the command - “lime build ios”. I see the generated xcode project. When i launch the project in xcode and try to build it, i get an error that tells me that the Class Main is not found.
I think it is coming from an autogenerated file, ApplicationMain.hx.

Unfortunately, i’m new to xcode and haxe/openfl/lime so i’m not sure if the generated files from openfl/lime is correct or not.

When i created an empty project from the mac machine using lime create openfl, compile this, it seems like it builds ok with xcode. So i’m not sure what i’m doing wrong here.

What is the correct way to build for ios?


Does it work for another target like flash or neko?

In your project.xml file, in the <app /> tag what is the value of the main attribute? Does it match the name of your Main class?

Yes, it works fine for Android, Flash, HTML 5. iOS is the one having issues.
In the project.xml the value does match.

The funny thing is that is if I create an openfl project from one of the samples (Adding Text), it builds fine and i can create an ipa but it fails to load onto my device which is another issue.

Examine the source-code of the generated file to be sure it does define the class, and that there is a static public entry-point procedure within it. (Since it’s auto-generated, there probably is.) Then, make sure that the project file correctly refers to that file so that it’s included.

Still can’t get this work. Searching the threads i can’t find a single place that explains the steps on how to generate the proper xcode project so i can then run on a mac to create an ipa.

When i run lime build ios, i see that the xcode project is created but when i open it up it looks like it is missing since i can’t find anything related to the haxe code in there.

Could someone help walk me through or at least point me to documentation to get this working?


Ok, i think i fixed my issue with building. Had to update the application.xml and point the source correctly.