godot: Can't build for iOS on XCode 9.2 - entry point (_main) undefined. for architecture i386
I am having the same problem as the user pip in QA.
Godot version: 3.0.2 stable
OS/device including version: MacBook Air (13-inch, Early 2014) (1,4 GHz Intel Core i5) MacOS High Sierra 10.13.3
Issue description: I should be able to build and run the generated XCode project. It does not build successfully.
Steps to reproduce:
I have installed the export templates and tried to export an empty Godot project.
- Project > Export > iOS(Runnable)
- Fill the required icons and launch screens.
- Enter App Store Team ID (This should be obsolete since Xcode automatically handles the signing now. The team ID can no longer be found on the apple dev website)
- Export project *.ipa (even tough Godot only exports the Xcode files and not an ipa file)
- Opened the generated .xcodeproj in XCode 9.2
- Changed to my personal team in iOSExport target > General > Signing > Team
When I hit build in Xcode I get these same error:
ld: warning: ignoring file /Users/alejandro/Godot3Projects/iOSExport.a, missing required architecture i386 in file /Users/alejandro/Godot3Projects/iOSExport.a (2 slices)
ld: entry point (_main) undefined. for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: warning: ignoring file /Users/alejandro/Godot3Projects/iOSExport.a, missing required architecture x86_64 in file /Users/alejandro/Godot3Projects/iOSExport.a (2 slices)
ld: entry point (_main) undefined. for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Note that one says architecture i386 and the other architecture x86_64.
Minimal reproduction project: Empty new project.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 27 (14 by maintainers)
I solved those problems by:
After that, I could get it to run on a physical device.
Are you trying to run on simulator (i386)? If so, the template won’t work.
Yes, I think you’re right. I had same result when I tried official beta template as well as custom build. I never got emulator to work, but real device is ok.
You could use the 3.1 beta 2 templates with the 3.1 beta 2 editor binary: https://godotengine.org/article/dev-snapshot-godot-3-1-beta-2
It’s actually
armv7
. Doesn’t matter in the end as if the arch argument is invalid, it buildsarmv7
.You need to collate the
x86
andx86_64
libraries here too.See the build scripts for 3.0.6 (missing
x86_64
, this has been added later on): https://notabug.org/hp/godot-scripts/src/master/build-godot-macosx.sh#L45-L53 https://notabug.org/hp/godot-scripts/src/master/build-godot.sh#L310-L317The reason you must turn automatically manage signing off and on is because by default it tries to use the Push Notifications and Game Center capabilities which non-paying devs don’t have permission to use. The easiest way to solve this is to:
Game Center
andPush Notifications
CapabilitiesIn Response to the original question: A quick web search shows that you generally get linker errors such as
clang: error: linker command failed with exit code 1 (use -v to see invocation)
due to missing libraries. For me it was theStoreKit.framework
. This is solved by going to Build Phases > Link Binary With Libraries And pressing the plus button to add a library. In my case I just searched forStoreKit
and added the library.Ah, it wasn’t clear that the project wouldn’t work for the simulator. I got it working on a device.
I’m getting the same error as @jahd2602, and I’ve entered my team id. I’m also not seeing a
.ipa
file generated on export.