xcode clang:错误:clang 前端命令失败,退出代码为 70(使用 -v 查看调用)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/45667117/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 10:11:20  来源:igfitidea点击:

clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)

iosobjective-cxcodellvm

提问by Junhyun Lee

I don't know what causes it.

我不知道是什么原因造成的。

It does not happen at iPhone 5 and simulators. It have been happened only my original device iPhone 7.

它不会发生在 iPhone 5 和模拟器上。只有我的原始设备 iPhone 7 发生过这种情况。

fatal error: error in backend: Error while trying to spill X0 from class GPR64: Cannot scavenge register without an emergency spill slot!
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Apple LLVM version 9.0.0 (clang-900.0.34.1)
Target: aarch64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
clang: note: diagnostic msg: PLEASE submit a bug report to http://developer.apple.com/bugreporter/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/xg/tgwkzqt15xd9jprnv9f0gn4c0000gn/T/CityArray-6e6c1e.m
clang: note: diagnostic msg: /var/folders/xg/tgwkzqt15xd9jprnv9f0gn4c0000gn/T/CityArray-6e6c1e.cache
clang: note: diagnostic msg: /var/folders/xg/tgwkzqt15xd9jprnv9f0gn4c0000gn/T/CityArray-6e6c1e.sh
clang: note: diagnostic msg: Crash backtrace is located in
clang: note: diagnostic msg: /Users/junhyun/Library/Logs/DiagnosticReports/clang_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
clang: note: diagnostic msg: (choose the .crash file that corresponds to your crash)
clang: note: diagnostic msg: 

********************

回答by Appic SandBox

I got this error when i was archiving my app with xcode - while running on sim and physical device worked -, but had my physical device still selected as a scheme. Solution worked for me: clean build folder, and select 'Generic IOS Device' as the scheme.

当我使用 xcode 归档我的应用程序时出现此错误 - 在 sim 和物理设备上运行时 - 但我的物理设备仍然被选为方案。解决方案对我有用:清理构建文件夹,然后选择“通用 IOS 设备”作为方案。

回答by Deepak A

Delete ~/Library/Developer/Xcode/DerivedDataworked for me. Issue is due to cache, since your using pods - you need to remove old references

删除~/Library/Developer/Xcode/DerivedData对我有用。问题是由于缓存,因为您使用 pod - 您需要删除旧引用

回答by Sankalp

This has been driving me nuts and I still can not pinpoint the reason for the crash. But a few of these steps or a combination of these seems to remedy it in the meanwhile.

这一直让我发疯,我仍然无法确定坠机的原因。但是,其中的一些步骤或这些步骤的组合似乎可以同时补救它。

  • Try doing a clean build.
  • Run pod install/ pod deintegrate.
  • Run npm installif you are working on a react native app after deleting node_modules
  • Close xcode and then delete ~/Library/Developer/Xcode/DerivedData
  • If nothing works try restarting the system.
  • 尝试进行干净的构建。
  • 运行pod install/ pod deintegrate.
  • 运行npm install如果你正在处理的反应后,删除本机应用程序node_modules
  • 关闭xcode然后删除 ~/Library/Developer/Xcode/DerivedData
  • 如果没有任何效果,请尝试重新启动系统。

回答by Dave

I used the following steps to get rid of the error:

我使用以下步骤来消除错误:

  • Clean cache from Xcode Product->Clean Build Folder
  • npm install
  • run react-native run-ios
  • Build the app using Xcode.
  • 从 Xcode Product->Clean Build Folder 清除缓存
  • 安装
  • 运行 react-native run-ios
  • 使用 Xcode 构建应用程序。

回答by edwin p

Delete ~/Library/Developer/Xcode/DerivedDataworked for me.

删除~/Library/Developer/Xcode/DerivedData对我有用。

回答by Albert Renshaw

I got this error when I hardcoded a massive array into a .h file. Worked fine on simulator, threw this error on device.

当我将一个庞大的数组硬编码到一个 .h 文件中时,我遇到了这个错误。在模拟器上运行良好,在设备上抛出了这个错误。

Changed the array to be empty and it compiled just fine.

将数组更改为空,它编译得很好。