Xcode 13.3 build "out of memory"

Hi everyone,

I'm new to iOS development and CI/CD and wondered if someone may be able to help

We have a build machine that uses Fastlane to build the app and distribute to testers etc

When the Xcode path is set to 13.1 it runs fine and it did on 13.2 (it looks like this version has automatically updated to 13.3 on the build machine)

On my local machine everything compiles fine on 13.1 AND 13.3 but now when the pipeline runs it gets to a certain package/point in the build process and fails with:

LLVM ERROR: out of memory
Allocation failed

The code branch is exactly the same, no changes to packages between Xcode builds. Any idea why 13.3 would throw a memory allocation error and what I could try next? Xcode 13.1 and 13.3 + command lines tools are both installed

Thank you!

Just confirmed working in the pipeline with 13.2.1 - guess it's an issue with the latest version?

I just updated my XCode to the latest version today and encountered this error as well, I don't have a CI/CD setup, just manual build process.

I have the same issue.

I have this issue too.

Having the same issue with the ZLPhotoBrowser library. https://github.com/longitachi/ZLPhotoBrowser/issues/699

Seeing the same issue with https://github.com/suzuki-0000/SKPhotoBrowser.

Has anyone found a reliable fix?

Same issue here when archiving. Xcode 13.2.1 was working fine. Xcode 13.3 betas were breaking with the "LLVM ERROR: out of memory" error. Xcode 13.3 final didn't fix this. Message asks to to submit a bug report and include project. Can't include project.

Hi there!

I'm my case, Xcode 13.3 was breaking with the "LLVM ERROR: out of memory" when archiving. Reading the error log, I've found something interesting: "Embedding bitcode". Well ... bitcode generation is optional. So I've disabled bitcode for that target: Build Settings -> Enable Bitcode = No.

And that's it! After turning off bitcode, Xcode 13.3 was able to archive with no more "LLVM ERROR: out of memory".

So search for "Embedding bitcode" in your Xcode's error log. If you find it, this is the cure ;-). If not, sorry, can't help you.

Hi there!

I'm my case, Xcode 13.3 was breaking with the "LLVM ERROR: out of memory" when archiving. Reading the error log, I've found something interesting: "Embedding bitcode". Well ... bitcode generation is optional. So I've disabled bitcode for that target: Build Settings -> Enable Bitcode = No. And that's it! After turning off bitcode, Xcode 13.3 was able to archive with no more "LLVM ERROR: out of memory". So search for "Embedding bitcode" in your Xcode's error log. If you find it, this is the cure ;-). If not, sorry, can't help you.

Thank you for the tip, I will take a look :)

Being new to iOS development, how important is bitcode? will become mandatory at some point? My very high level. understanding is it's a step to optimise the app binaries?

Can confirm that turning off bitcode in a linked framework did the trick with Xcode 13.3.

Can't say if or when bitcode will become mandatory, but I hope Apple fix this before making bitcode mandatory. Google bitcode - there are some great docs and articles about it. Please share if the tip has helped you.

In my case I am using UI_USER_INTERFACE_IDIOM() that causes Xcode 13.3 with Swift 5.6 to fail. My fix is to replace UI_USER_INTERFACE_IDIOM() into UIDevice.current.userInterfaceIdiom.

12

Same issue here after updating to Xcode 13.3:

error: backend command failed due to signal 6 (use -v to see invocation)
LLVM ERROR: out of memory
Allocation failed
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
0.	Program arguments: /Applications/Xcode-13.3.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /var/folders/7q/ywjd0rsx6zd7vqsy2pgsn_1h0000gp/T/TemporaryDirectory.Vhfg03/CardStackComponents-1.bc -embed-bitcode -target arm64-apple-ios12.2 -Xllvm -aarch64-use-tbi -Osize -disable-llvm-optzns -module-name CardStackComponents -o buck-out/gen/Libraries/uCardStackComponents/CardStackComponents#apple-swift-compile,iphoneos-arm64/CardStackComponents.o
1.	Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8)
2.	Compiling with the current language version
3.	Running pass 'Function Pass Manager' on module '/var/folders/7q/ywjd0rsx6zd7vqsy2pgsn_1h0000gp/T/TemporaryDirectory.Vhfg03/CardStackComponents-1.bc'.
4.	Running pass 'ObjC ARC contraction' on function '@UI_USER_INTERFACE_IDIOM'

For curiosity, the error doesn't happen if I build with -Onone instead of -Osize. This is not a workaround, obviously. I want to build my releases with optimization.

Bitcode is not really important for Developer, BUT it is very important for user. because using bitCode App Store Compiler can make out app size become very very small than before

Xcode 13.3 build "out of memory"
 
 
Q