iosswiftxcodeswiftlintxcode11.3

Command PhaseScriptExecution failed with a nonzero exit code Xcode 11.3.1


I am getting Command PhaseScriptExecution failed with a nonzero exit code error frequently, The below workarounds which I followed but didn't help me.

Workaround1: Keychain Access -> Right-click on login -> Lock & unlock again -> Clean Xcode project ->Make build again

Workaround2: Build Phases -> Targets -> Embedded pods frameworks "Run script only while installing"

Workaround3: Deleting the derived data

Workaround2: Clean project and building again.

Find the below log

Library/Developer/Xcode/DerivedData/CompanyName-
bofekdusvsoagmhinknpcoyjfyoj/Build/Intermediates.noindex/CompanyName.build/Debug-
iphonesimulator/company-iOS.build/Script-2AD2DCB21F0D6514005CEF4D.sh: line 2: 20846 
Segmentationfault: 11  ../BuildSupport/swift_lint_check.sh

Solution

  • This may happen when you click "Deny" on Keychain access dialog, after this, you can make Workaround1 and then try to restart your Mac. Also not forget to use the latest version of swiftlint and pods, make pod update SwiftLint. After the restart, you can try to make:

    $ sudo gem install cocoapods-deintegrate cocoapods-clean
    $ pod deintegrate
    $ pod clean