简体   繁体   中英

Cordova XCode Build iOS throw clang: error: unable to execute command: Segmentation fault: 11

I have developed a mobile application using Apache Cordova. Now I need to build the iOS platform but I get the following error:

clang: error: unable to execute command: Segmentation fault: 11 clang: error: clang frontend command failed due to signal (use -v to see invocation) Apple LLVM version 7.3.0 (clang-703.0.31) Target: x86_64-apple-darwin15.5.0 Thread model: posix InstalledDir: /Applications/Xcode.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: error: unable to execute command: Segmentation fault: 11 clang: note: diagnostic msg: Error generating preprocessed source(s).

I have read more about this error on Stack Overflow but none of them solved my problem. I have done these steps too:

  • Upgrade xCode to 7.3.1
  • Disable BitCode
  • Specify the Deployment Target
  • Clean and Build the project
  • Remove and add plugins
  • Remove and add iOS platform
  • Remove DerivedData
  • Close xCode, load another project and build it, then load this project but failed to build!

I am able to build and run OSX, Android and Browser version of my application without any problem!

Error's detailed info:

CompileC /Users/vahidfarahmandian/Library/Developer/Xcode/DerivedData/XXX-ewdzeukjxrvcrbeafzrgtkhzjkgu/Bui ld/Intermediates/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Objects-normal/x86_64/CDVViewController.o Classes/Public/CDVViewController.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd "/Volumes/VMware Shared Folders/zz.vvv.bbb/platforms/ios/CordovaLib"
    export LANG=en_US.US-ASCII
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-x objective-c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c99 -fobjc-arc -fmodules -fmodules-cache-path=/Users/vahidfarahmandian/Library/Developer/Xcode/DerivedData/ModuleCache
-fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/vahidfarahmandian/Library/Developer/Xcode/DerivedData/ModuleCache/Session.modulevalidation
-fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-implicit-atomic-properties -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk
-fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mios-simulator-version-min=6.0 -g -Wno-sign-conversion -fobjc-abi-version=2 -fobjc-legacy-dispatch -iquote /Users/vahidfarahmandian/Library/Developer/Xcode/DerivedData/XXX-ewdzeukjxrvcrbeafzrgtkhzjkgu/Build/Intermediates/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Cordova-generated-files.hmap
-I/Users/vahidfarahmandian/Library/Developer/Xcode/DerivedData/XXX-ewdzeukjxrvcrbeafzrgtkhzjkgu/Build/Intermediates/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Cordova-own-target-headers.hmap
-I/Users/vahidfarahmandian/Library/Developer/Xcode/DerivedData/XXX-ewdzeukjxrvcrbeafzrgtkhzjkgu/Build/Intermediates/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Cordova-all-target-headers.hmap
-iquote /Users/vahidfarahmandian/Library/Developer/Xcode/DerivedData/XXX-ewdzeukjxrvcrbeafzrgtkhzjkgu/Build/Intermediates/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Cordova-project-headers.hmap
-I/Users/vahidfarahmandian/Library/Developer/Xcode/DerivedData/XXX-ewdzeukjxrvcrbeafzrgtkhzjkgu/Build/Products/Debug-iphonesimulator/include
-I/Users/vahidfarahmandian/Library/Developer/Xcode/DerivedData/XXX-ewdzeukjxrvcrbeafzrgtkhzjkgu/Build/Intermediates/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/DerivedSources/x86_64
-I/Users/vahidfarahmandian/Library/Developer/Xcode/DerivedData/XXX-ewdzeukjxrvcrbeafzrgtkhzjkgu/Build/Intermediates/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/DerivedSources
-F/Users/vahidfarahmandian/Library/Developer/Xcode/DerivedData/XXX-ewdzeukjxrvcrbeafzrgtkhzjkgu/Build/Products/Debug-iphonesimulator
-DDEBUG -include /Users/vahidfarahmandian/Library/Developer/Xcode/DerivedData/XXX-ewdzeukjxrvcrbeafzrgtkhzjkgu/Build/Intermediates/PrecompiledHeaders/CordovaLib_Prefix-dwnzgdewwbvmytankebmwsdayrpm/CordovaLib_Prefix.pch
-MMD -MT dependencies -MF /Users/vahidfarahmandian/Library/Developer/Xcode/DerivedData/XXX-ewdzeukjxrvcrbeafzrgtkhzjkgu/Build/Intermediates/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Objects-normal/x86_64/CDVViewController.d
--serialize-diagnostics /Users/vahidfarahmandian/Library/Developer/Xcode/DerivedData/XXX-ewdzeukjxrvcrbeafzrgtkhzjkgu/Build/Intermediates/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Objects-normal/x86_64/CDVViewController.dia
-c /Volumes/VMware\ Shared\ Folders/zz.vvv.bbb/platforms/ios/CordovaLib/Classes/Public/CDVViewController.m
-o /Users/vahidfarahmandian/Library/Developer/Xcode/DerivedData/XXX-ewdzeukjxrvcrbeafzrgtkhzjkgu/Build/Intermediates/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Objects-normal/x86_64/CDVViewController.o

I have solved it finally.

I was serving my Cordova app via Shared Folder in VM to Mac OS. I have just moved my Cordova app to Mac instead of serving in Shared Folder. Then remove the iOS platform and re-add it.

Now my app builds successfully in xCode.

Also I found some very helpful information in the following link that might be helpful in case none of the above mentioned methods solve the problem: http://stack2.ocim.top/10592601/apple-llvm-compiler-3-1-error-ios-5-xcode-4-3.html

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