-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build in Xcode gives the error: ld: entry point (_main) undefined. for architecture arm64 #62929
Comments
Official export template does not include ARM64 simulator binaries (it's built on Linux using OSXCross, which does not support building for ARM64 simulator). You can build ARM64 simulator yourself ( Edit: Docs seems to be outdated, correct build flags for ARM64 simulator binary are:
|
Well, Im trying to compile the export templates and it gives me this error in the terminal when I use the
It looks like Im need to update the iOS SDK, but I dont now how (yes, Im new with publishing in App Store and also new with using a Mac) Also, anybody has published an unoficial export templates with the arm64 binaries? I looked to this site where it has some updated export templates, but it doesn't work giving me the same error |
What macOS version is your Mac running (and what Mac model are you using)? Unfortunately, if your Mac is very old, it may not be able to have a recent enough Xcode version installed (with iOS SDK 13.0 or later). |
Its a MacBook Air M1 2020 and the MacOS ver. is MacOS Monterey 12.4 I don't think that the problem is the Mac, it's too new, maybe the iOS SDK needs to be updated separately? Edit: I run the game in the "This Mac" simulator, it worked, now I don't know if its needed to run an iPhone simulation in Xcode before release or if I can send to revision the game even without test it in the simulator, and I don't know if something like that can be a problem (because the missing arm64 binaries) |
I'm also encountering this problem on Godot 4alpha12. I followed the steps above and copied |
Hi, I have resolved this problem by adding arm64 to the list of excluded architectures (simulator only) on the XCode Build Settings. |
Thank you for offering a workaround. Where do you find the arch list only for simulator? |
I have also solved the problem by excluding the arm64 architecture. Select your App in project column => Excluded architectures => (Debug and Release) Any iOs Simulator SDK |
May I ask what do you mean by "project column"? Where do I find this excluded architectures section? |
|
@Naionel Ive been documenting my build for iOS with Godot 3.5.1. This is what I wrote: Step 3. Build for Arm64 on MacOS. Godot's export templates for iOS are built using Linux OSXCross which does NOT support ARM64. Therefore for Arm64 targets you must build the export templates for Godot on a Arm64 Mac. This can be done with the following command inside the Godot repository.
Fix: If you get an error saying that xcrun cannot find the SDK you need to open Xcode -> Preferences -> Locations -> Command Line Tools -> Then select your tools. Then try the above commands again. Step 4: Custom Arm64 binaries are added to the Godot framework binaries (.a files) These custom export templates are then added to the Xcode Framework exported by Godot in the folder: "xcode_mobileapp1.xcframework" where "xcode_mobileapp1" is the name of the exported project, yours will be your own. Inside we find two folders:
Inside the "ios-arm64_x86_64-simulator" folder we find a libgodot.a file. We are going to combine that with our binary. I will use a debug binary here for testing but the process is the same for release. I copy the Arm64 binary from Step 3 into the folder and make a copy of libgodot.a as a backup. We run the following command to combine them:
Now the Xcode Iphone simulator should work! However: When I simulate an Iphone (Often a model 13), every frame I see an Error: 502 and I see a visual glitch on a textured mesh. The simulator also runs poorly at 7 fps. These issues do no present on a Mac build or if ran on my device: Iphone SE (2nd Generation). References: https://docs.godotengine.org/en/3.5/development/compiling/compiling_for_ios.html How iOS templates are zipped: Step 5. Running the simulator. (In Progress) Issue: Running the iPhone simulator (13/SE 3rd Gen) displays artifacts in 3D on the only textured surface and I get an error 502 printed each frame. Performance on the simulator is also poor at about 7 fps on my M1 Macbook Air. If I test on my device, the Iphone SE (2nd Gen) the app looks and runs great and there are no visual artifacts. As per this Godot github issue this might be caused by the simulator emulating OpenGL support in a Metal environment. Only testing on an actual SE (3rd Gen) device will resolve this simulator-device discrepancy. |
Getting same error in my react native project, this error came when I renamed my project from xyz.xcodeworkspace to abc.xcodeworkspace |
I'm not able to get this working. I followed the instructions provided by @Riordan-DC above where I
After that, the build succeeded and Xcode was able to start the simulator but I got a warning about Vulkan: Even if this worked, I'm probably doing something stupid here because this means I'd have to manually merge the binaries with Anyways, regarding the error in the screenshot. My setup:
Going to tag a related post #70662 and @Calinou. I apologize for the buzz in advance. |
Godot version
v3.4.4.stable.official [419e713]
System information
MacBook Air (M1, 2020), MacOS Monterey 12.4
Issue description
When I Try to build and run the simulation in Xcode it keep me showing this error:
ld: entry point (_main) undefined. for architecture arm64
Viewing others Issues and people that happened something similar, I made the conclusion that the problem may be in the Godot Export Templates, but Im not sure if this is the case, also, the Xcode log gives me this warning:
ld: warning: ignoring file /Users/personale/Library/Developer/Xcode/DerivedData/GELATO_ESPRESSO_GAME_1.1.0-gdmnsorzziyfncbhrzowwqvzlbus/Build/Products/Release-iphonesimulator/libgodot.a, building for iOS Simulator-arm64 but attempting to link with file built for iOS Simulator-x86_64
Note that last line: building for iOS Simulator-arm64 but attempting to link with file built for iOS Simulator-x86_64
I supused that the problem is in that file, so it can be a problem with the Godot export?
So, my hypothesis is that Godot is exporting the project with a file configured to x86, but not to armv64, giving this error, the Mac that Im using for build the project has an Apple M1, I think that if I try to build it in a Mac with an Intel processor it may work.
So, somebody can help me with this problem? Is this a problem that can be solved in the Xcode configuration? or is a problem with the Godot Export Templates?
Steps to reproduce
Export you project for iOS with the following configuration:
Import the project to Xcode
Build the project
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: