7

I have integrated SwiftLint using pods and its working fine to produce warnings and errors. But I want to configure .yml file. For this I use following command on terminal.

swiftlint lint --config MyFile.yml

and getting following error...

fatal error: Loading sourcekitd.framework/Versions/A/sourcekitd failed: file /Users/marcelofabri/Westfield/SwiftLint/Carthage/Checkouts/SourceKitten/Source/SourceKittenFramework/library_wrapper.swift, line 61 Illegal instruction: 4

Please let me know how to solve this issue.

Mohsin Qureshi
  • 1,203
  • 2
  • 16
  • 26
  • Hello Mohsin.. did you get any solution ? i am facing the same problem when trying to run 'swiftlint autocorrect' . :( – Bandish Dave Mar 27 '17 at 08:58

2 Answers2

21

This issue may occurred, because command line tool is not set in xcode. To solve the issue.

Xcode->preference->select Location Tab

In the "Command Line Tools" menu select the appropriate xcode.

enter image description here

enter image description here

Saleh Enam Shohag
  • 1,039
  • 1
  • 12
  • 23
  • 2
    I got similar error when using https://github.com/Brightify/Cuckoo "SourceKittenFramework/library_wrapper.swift:66: Fatal error: Loading sourcekitd.framework/Versions/A/sourcekitd failed". This solves it too. Thanks! – Hlung Jun 29 '22 at 06:11
0

Another way to solve the issue using Terminal:

sudo xcode-select --reset
Anton Plebanovich
  • 1,296
  • 17
  • 17