Skip to content

Loading sourcekitd fails #1466

Closed
Closed

Description

@PraveenSingh107

I started facing this fatal error while running the lint command.

fatal error: Loading sourcekitd.framework/Versions/A/sourcekitd failed: file /tmp/swiftlint-20160824-65136-lo3uim/Carthage/Checkouts/SourceKitten/Source/SourceKittenFramework/library_wrapper.swift, line 59
.git/hooks/pre-commit: line 7: 32011 Illegal instruction: 4 ${SWIFT_LINT} lint --strict --quiet --path ${filename}

Any suggestions why suddenly this fatal error is stopping swiftlint?

Activity

  1. jpsim commented on Apr 25, 2017

    @jpsim
    Collaborator

    Have you installed Xcode? What's the result of xcode-select -p?

  2. added
    question
    on Apr 25, 2017
  3. PraveenSingh107 commented on Apr 26, 2017

    @PraveenSingh107
    Author

    Yeah, i've installed xcode. swiftlint was working fine but suddenly it started throwing this error.
    Output of xcode-select -p : /Library/Developer/CommandLineTools

  4. jpsim commented on Apr 26, 2017

    @jpsim
    Collaborator

    The command line tools located at /Library/Developer/CommandLineTools do not contain a Swift toolchain.

    Where have you installed Xcode? If it's installed under /Applications/Xcode.app, please run:

    sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
    

    If it's installed elsewhere, please replace the /Applications/Xcode.app path in the command above to the location where you've installed Xcode.

  5. PraveenSingh107 commented on Apr 26, 2017

    @PraveenSingh107
    Author

    Thanks. Issue got resolved

  6. ulkoart commented on Apr 24, 2020

    @ulkoart

    The command line tools located at /Library/Developer/CommandLineTools do not contain a Swift toolchain.

    Where have you installed Xcode? If it's installed under /Applications/Xcode.app, please run:

    sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
    

    If it's installed elsewhere, please replace the /Applications/Xcode.app path in the command above to the location where you've installed Xcode.

    Thank you so much! advice helped me.

  7. koushikkarmakar commented on May 4, 2020

    @koushikkarmakar

    The command line tools located at /Library/Developer/CommandLineTools do not contain a Swift toolchain.

    Where have you installed Xcode? If it's installed under /Applications/Xcode.app, please run:

    sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
    

    If it's installed elsewhere, please replace the /Applications/Xcode.app path in the command above to the location where you've installed Xcode.

    thanks a lot !! it helped me as well :)

  8. americo677 commented on Oct 29, 2021

    @americo677

    The command line tools located at /Library/Developer/CommandLineTools do not contain a Swift toolchain.

    Where have you installed Xcode? If it's installed under /Applications/Xcode.app, please run:

    sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
    

    If it's installed elsewhere, please replace the /Applications/Xcode.app path in the command above to the location where you've installed Xcode.

    Thank you jpsim!, It works for me!. macOS Big sur 11.6.

  9. sanket492 commented on May 5, 2023

    @sanket492

    The command line tools located at /Library/Developer/CommandLineTools do not contain a Swift toolchain.

    Where have you installed Xcode? If it's installed under /Applications/Xcode.app, please run:

    sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
    

    If it's installed elsewhere, please replace the /Applications/Xcode.app path in the command above to the location where you've installed Xcode.

    Thank you @jpsim from bottom of my heart, this helped me to resolve my issue

  10. ObjectiveCesar commented on Jun 18, 2024

    @ObjectiveCesar

    The command line tools located at /Library/Developer/CommandLineTools do not contain a Swift toolchain.

    Where have you installed Xcode? If it's installed under /Applications/Xcode.app, please run:

    sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
    

    If it's installed elsewhere, please replace the /Applications/Xcode.app path in the command above to the location where you've installed Xcode.

    This is not sufficient, if you have a nightly/snapshot swift toolchain installed. See: #5325 (comment)

  11. lucaomr commented on Sep 18, 2024

    @lucaomr

    Thanks, this help me a lot!

  12. pinned this issue on Jan 27, 2025
  13. metasidd commented on Feb 5, 2025

    @metasidd

    Small nit for non-developers like me who struggled with the command above. If you're running...

    sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
    

    and are seeing the error below,

    xcode-select: error: invalid developer directory '/Applications/Xcode.app/Contents/Developer'
    

    You likely have a separate XCode app name. Try running something like this

    sudo xcode-select -s /Applications/Xcode\ 16.app/Contents/Developer
    

    Hope it helps 🙏

  14. changed the title [-]fatal error: Loading sourcekitd.framework/Versions/A/sourcekitd failed[/-] [+]Loading `sourcekitd` fails[/+] on Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions