Need Help No such file or directory.....il2cpp.a File (Command Ld failed with a nonzero exit code) ios, Xcode

I have been struggling with an error for several days:

clang++: error: no such file or directory: ‘/Users/apple/Library/Developer/Xcode/DerivedData/Unity-iPhone-eapfskczvszxtlcrklqkxwdvgntq/Build/Products/ReleaseForRunning-iphoneos/il2cpp.a’
Command Ld failed with a nonzero exit code

I created a build of my project (including all plugins) and tested it on an iOS phone as a development build. It worked fine on the device. After creating a build for release, I started encountering this error.

  • Suspecting plugin issues, I removed all plugins but the error persisted.
  • Created a new, empty Unity project and attempted to build it with Xcode. Surprisingly, the same error occurred.
    I have exhausted my troubleshooting options and need help resolving this error. Any guidance would be greatly appreciated.
    I am using Unity 6.000.0.33f1
    Never experienced this before in previous versions.
2 Likes

I am having the same issue , have you solved it ? if yes could you help me

I have the exact same problem with 6.000.0.40f1

me too!! Ive spent 12 hours troubleshooting all the little offshoots of this issue and still run into this. I can’t think of a single reason why it is not working.

I also encountered the same problem. I have been troubleshooting for a long time and tried various methods, but none of them worked. I want to ask if you have solved it now?

Did you solve it?

it is because you are running it on a simulator, it should be a device instead

Unity 6 has dropped automatic support for compiling the il2cpp.a static library when building for iOS. However, you can still find the uncompiled IL2CPP source files in the exported project under:

[Your Exported Unity Project]/Il2CppOutputProject/IL2CPP/libil2cpp

To resolve the error:
clang++: error: no such file or directory: ‘…/il2cpp.a’
Command Ld failed with a nonzero exit code

You have two main options:

  1. Manually compile the IL2CPP source into libil2cpp.a using your own Xcode build settings. This can be complex but gives you full control.

  2. Use Unity 2022.3.61f1 (LTS)(not specific to this version. but this is what i used) instead. This version still outputs the libil2cpp.a file automatically in the Libraries folder when you build with IL2CPP backend. It’s a reliable workaround if you’re not tied to Unity 6.

Also, make sure you build using the Device SDK (ARM64) and test on a real iOS device — this avoids many issues that occur with simulator builds and IL2CPP.

I had resolved this sh*t issue that deleted Library and Temp folders in your Unity Project and restart Unity again and output Xcode project, then you can find the world are beautiful.
My version is 2023.2.20.f1c1

In the File → Build Profiles panel I had to enable Symlink Sources. This fixed it for me.

@elliselkins The error persists here, what version of Unity and Xcode do you have?

Unity 6000.0.32f1
Xcode 16.4

It is still happening on Unity 6000.0.55f1. macOS 15.6, Xcode 16.2 & 16.4, M4 Max.

This is a nearly empty project. iOS build works without any problem. My latest error:

cp: /Users/USERNAME/Library/Developer/Xcode/DerivedData/macOS-gorgnkprasdasdasdciekxjfvlecy/Build/Products/Debug/il2cpp.usym: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code

There is also no problem when I directly build as macOS app; it works (but I need to build from Xcode). I’ll probably send a bug report, because I think nobody sent it yet.

UPDATE: I think I found the problem. If you selected IL2CPP Stacktrace Information as “Method Name, File Name, and Line Number”; the build will fail in Xcode. And if you select “Method Name”; the build will not fail in Xcode. I’ll create a bug report with a minimal project; but for now, this is my workaround.

CASE IN-112175
UUM-114549

This might not be related to the original thread. Because I can’t reproduce this in iOS builds (I tried ~50 different build scenarios for macOS & iOS).

Still happening to me. I have tried both

  1. Adding a new scheme and changing the “identity and Type” with the same name
  2. IL2CPP stack trace set to “Method Name”

Hello! Can you help point me on how to manually compile the IL2CPP source?