Xcode 13.3 - LLVM Error when building app

Just upgraded from Xcode 12 to Xcode 13.3 (latest) and now suddenly am getting a LLVM Error when archiving my app. See error message below.

Google tells me that many users seem to have this issue, some related to unused dependencies or not enough memory, neither of which is the case for me.

Appreciate if one of the experts here can advise, pretty new to Xcode and not sure how to best proceed.

Thank you

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.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/User/Library/Developer/Xcode/DerivedData/WebViewGold-glchvbqylkvqybgbbhuuzlgneyle/Build/Intermediates.noindex/ArchiveIntermediates/WebViewGold/IntermediateBuildFilesPath/AG-Opus.build/Release-iphoneos/Appname.build/Objects-normal/arm64/WebViewController.bc -embed-bitcode -target arm64-apple-ios12.0 -Xllvm -aarch64-use-tbi -O -disable-llvm-optzns -module-name AG_Opus -o /Users/User/Library/Developer/Xcode/DerivedData/WebViewGold-glchvbqylkvqybgbbhuuzlgneyle/Build/Intermediates.noindex/ArchiveIntermediates/WebViewGold/IntermediateBuildFilesPath/Appname.build/Release-iphoneos/Appname.build/Objects-normal/arm64/WebViewController.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 '/Users/User/Library/Developer/Xcode/DerivedData/WebViewGold-glchvbqylkvqybgbbhuuzlgneyle/Build/Intermediates.noindex/ArchiveIntermediates/WebViewGold/IntermediateBuildFilesPath/Appname.build/Release-iphoneos/Appname.build/Objects-normal/arm64/WebViewController.bc'.

4.	Running pass 'ObjC ARC contraction' on function '@UI_USER_INTERFACE_IDIOM'

Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):

0  swift-frontend           0x000000010eb13de7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 39

1  swift-frontend           0x000000010eb12e38 llvm::sys::RunSignalHandlers() + 248

2  swift-frontend           0x000000010eb14440 SignalHandler(int) + 288

3  libsystem_platform.dylib 0x00007ff804caedfd _sigtramp + 29

4  libsystem_malloc.dylib   0x00007ff804accabb _malloc_zone_malloc + 125

5  libsystem_c.dylib        0x00007ff804be4d24 abort + 123

6  swift-frontend           0x000000010ea60cda llvm::report_bad_alloc_error(char const*, bool) + 106

7  swift-frontend           0x000000010ea60cf2 out_of_memory_new_handler() + 18

8  libc++abi.dylib          0x00007ff804c5696b operator new(unsigned long) + 43

9  swift-frontend           0x000000010e821efd llvm::Function::BuildLazyArguments() const + 77

10 swift-frontend           0x000000010c60ae87 llvm::objcarc::BundledRetainClaimRVs::insertRVCallWithColors(llvm::Instruction*, llvm::CallBase*, llvm::DenseMap<llvm::BasicBlock*, llvm::TinyPtrVector<llvm::BasicBlock*>, llvm::DenseMapInfo<llvm::BasicBlock*>, llvm::detail::DenseMapPair<llvm::BasicBlock*, llvm::TinyPtrVector<llvm::BasicBlock*> > > const&) + 151

11 swift-frontend           0x000000010c61df88 (anonymous namespace)::ObjCARCContract::run(llvm::Function&, llvm::AAResults*, llvm::DominatorTree*) + 1384

12 swift-frontend           0x000000010e859380 llvm::FPPassManager::runOnFunction(llvm::Function&) + 1488

13 swift-frontend           0x000000010e860073 llvm::FPPassManager::runOnModule(llvm::Module&) + 67

14 swift-frontend           0x000000010e859b39 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1161

15 swift-frontend           0x0000000109d776df swift::performLLVMOptimizations(swift::IRGenOptions const&, llvm::Module*, llvm::TargetMachine*) + 3791

16 swift-frontend           0x0000000109d788cc swift::performLLVM(swift::IRGenOptions const&, swift::DiagnosticEngine&, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, llvm::StringRef, swift::UnifiedStatsReporter*) + 2812

17 swift-frontend           0x0000000109d81aa5 swift::performLLVM(swift::IRGenOptions const&, swift::ASTContext&, llvm::Module*, llvm::StringRef) + 213

18 swift-frontend           0x000000010983c795 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 16565

19 swift-frontend           0x00000001097fb5d4 swift::mainEntry(int, char const**) + 1108

20 dyld                     0x000000011ceb751e start + 462

error: Abort trap: 6 (in target 'Appname' from project 'Projectname')

Replies

Only replace all occurrences of UI_USER_INTERFACE_IDIOM with UIDevice.current.userInterfaceIdiom and try again. Good luck!

Add a Comment