简体   繁体   中英

Building with Xcode 12.5 fails with CompileSwift failed with a nonzero exit code and Segmentation fault: 11

Project building started failing when I updated Xcode to 12.5. I'm getting two errors: CompileSwift failed with a nonzero exit code and Segmentation fault: 11
Each of these errors is printing out bunch of swift files which are normally used in project.
I've tried with clean build, removing derived data, updating pods, and even restarting laptop and nothing works.
Checkout images: 在此处输入图像描述

在此处输入图像描述

TL;DR;

My case, one of my swiftUI file, before Xcode 12.5:

let top = geometry.size.with, bottom = g.size.height

The new fix:

let top = geometry.size.with
let bottom = g.size.height

I had similar issue, some of my swift files are not recognising core data entities' property with only Xcode 12.5 , and many files shows segment fault 11 error with no details at all.

What I found is that, even some swift files are with no compel error, if you open it, then it will shows some of the error with details. So you can try to open every single source code file, and wait for the Xcode to highlight the swift syntax, if the syntax can be highlighted it will be fine, and if not, it may show some detailed errors.

I didn't find the solution for this with Xcode 12.5 but everything works fine on Xcode 13 beta.
So, installing Xcode 13 fixed this issue for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM