我们上周更新了xcode版本11.6到12.4。一切都很完美。在这次更新之后,我们得到了这个问题。我们尝试了以下步骤:
-clean / re-build
-removed derived data
-removed valid-archs from build settings
-added arm64 to Excluded Architectures
-reboot mac但我们仍然面临着同样的问题。这些日志没有给出我们需要更改的类的适当信息。这些是我们尝试运行应用程序时得到的错误日志:
0 swift 0x000000010984e615 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1 swift 0x000000010984d615 llvm::sys::RunSignalHandlers() + 85
2 swift 0x000000010984ebcf SignalHandler(int) + 111
3 libsystem_platform.dylib 0x00007fff70f0f5fd _sigtramp + 29
4 libsystem_platform.dylib 0x00007f8a8a354900 _sigtramp + 18446743571622286112
5 swift 0x00000001057c537b emitApplyArgument((anonymous namespace)::IRGenSILFunction&,
swift::SILValue, swift::SILType, swift::irgen::Explosion&) + 283
6 swift 0x00000001057c441a (anonymous
namespace)::IRGenSILFunction::visitFullApplySite(swift::FullApplySite) + 3770
7 swift 0x00000001057a2d26 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 8982
8 swift 0x000000010563b457
swift::irgen::IRGenerator::emitGlobalTopLevel(llvm::StringSet<llvm::MallocAllocator>*) + 1607
9 swift 0x0000000105777c37 performIRGeneration(swift::IRGenOptions const&, swift::ModuleDecl,
std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef,
swift::PrimarySpecificPaths const&, llvm::StringRef, swift::SourceFile, llvm::GlobalVariable*,
llvm::StringSet<llvm::MallocAllocator>) + 1687
10 swift 0x00000001057a0781 swift::SimpleRequest<swift::IRGenSourceFileRequest,
swift::GeneratedModule (swift::IRGenDescriptor),
(swift::RequestFlags)9>::evaluateRequest(swift::IRGenSourceFileRequest const&, swift::Evaluator&) +
97
11 swift 0x000000010577c04c llvm::Expected<swift::IRGenSourceFileRequest::OutputType>
swift::Evaluator::getResultUncached<swift::IRGenSourceFileRequest>(swift::IRGenSourceFileRequest
const&) + 940
12 swift 0x000000010577829d swift::performIRGeneration(swift::IRGenOptions const&,
swift::SourceFile&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>
>, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::GlobalVariable*,
llvm::StringSet<llvm::MallocAllocator>) + 269
13 swift 0x00000001053c21ba performCompileStepsPostSILGen(swift::CompilerInstance&,
swift::CompilerInvocation const&, std::__1::unique_ptr<swift::SILModule,
std::__1::default_delete<swift::SILModule> >, llvm::PointerUnion<swift::ModuleDecl,
swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver) + 3002
14 swift 0x00000001053b1d97 swift::performFrontend(llvm::ArrayRef<char const*>, char const, void,
swift::FrontendObserver*) + 20695
15 swift 0x0000000105332c27 main + 1255
16 libdyld.dylib 0x00007fff70d12cc9 start + 1
17 libdyld.dylib 0x00000000000001ac start + 18446603338623407332
error: Segmentation fault: 11 (in target 'ProjectName' from project 'ProjectName')下面是我们正在使用的吊舱:
pod 'p2.OAuth2', '~> 3.0.0'
pod 'SwiftyJSON', '~> 3.0.0'
pod 'CryptoSwift', '0.8.3'我们怎么才能解决这个问题?任何帮助都很感激。
谢谢。
发布于 2021-03-25 05:10:49
最近,我还完成了从Xcode 11.7到12.4的升级,并在我的项目中的许多Swift文件上得到了相同的Swift错误,奇怪的是,大多数情况下,这些错误没有正确的描述或推理。
我在这方面花了大约一个星期的时间,找到了一个对我有用的解决方案。
有一个名为BUILD的SWIFT_COMPILATION_MODE设置,只需将该属性设置为Whole Module并构建项目即可。现在,XCode将开始为您提供一些可以理解的描述错误。你可以继续改正那些错误。
一旦解决了这些错误,就可以将该属性设置为以前的值,即Incremental

注意:它仍然不会给出错误行号,但是它会给出这个错误所在的类和方法的名称,错误计数也会减少到实际计数。您可以对该函数中的所有行进行注释,并尝试一次取消一个(或多个)注释,并构建您的项目以找出有问题的行。
这就是我如何能够解决这些错误,希望这有助于你解决你的。
https://stackoverflow.com/questions/66422432
复制相似问题