“${PODS_ROOT}/SwiftLint/swiftlint” causes “Command

2020-02-02 17:37发布

Updating from Xcode 10.0 beta 2 to Xcode 10.0 beta 3 I now get this error at build time for an iOS project:

sourcekit: [1:connection-event-handler:10499: 0.0000] Connection interruptsourcekit: [1:updateSemanticEditorDelay:10499: 0.0007] disabling semantic editor for 10 secondssourcekit: [1:pingService:10499: 0.0007] pinging servicesourcekitten: connection to SourceKitService restored!
Connection interrupted
Never call this for file that sourcekitd fails.: file File+Cache.swift, line 127
/Users/Coeur/Library/Developer/Xcode/DerivedData/My-App-eloayqptodupvfhbyegtkncnhcpu/Build/Intermediates.noindex/My-App.build/UAT-iphonesimulator/My-App-Debug.build/Script-379156A71D62F5C100574D04.sh: line 2: 34382 Abort trap: 6 "${PODS_ROOT}/SwiftLint/swiftlint"
Command PhaseScriptExecution failed with a nonzero exit code

Swift 4.1
CocoaPods 1.5.3
SwiftLint 0.26.0

17条回答
爷、活的狠高调
2楼-- · 2020-02-02 18:17

It seems to be an issue with the SwiftLint 0.26.0 script when using Xcode 10.0 beta 3 or newer.

Cause

It seems related to SwiftLint #2276, itself related to SourceKitten 0.21.0, fixed in SourceKitten 0.21.1 and SwiftLint Master.

Solution

Update to SwiftLint 0.27.0 or newer:

pod 'SwiftLint', '~> 0.27'

(and run pod update SwiftLint)

查看更多
疯言疯语
3楼-- · 2020-02-02 18:17

I had a new Macbook and got this error when trying to archive. I forgot to install cocopods in the new machine, so I did, then restarted the computer and restarted Xcode and it worked.

查看更多
我欲成王,谁敢阻挡
4楼-- · 2020-02-02 18:18

This issue resolves for me when I wait and let the project complete indexing before I do anything!

查看更多
倾城 Initia
5楼-- · 2020-02-02 18:19

I just restarted my Macbook and it worked.

查看更多
Emotional °昔
6楼-- · 2020-02-02 18:19

For me, there seems to be an issue with the swiftlint script. It was initially this, Which was what was in the doc as of the time of installation

else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi

I resolve the issue by modifying it to

if swiftlint
then
echo "swiftlint installed"
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi

Not sure, this may be due to my XCode version(10.3)

查看更多
萌系小妹纸
7楼-- · 2020-02-02 18:21

Its because of Keychain Access.

  • Open Keychain Access
  • Right Click Login Tab
  • Lock Keychain Login
  • Right Click Login Tab again
  • Unlock Keychain Login

and problem solved :)

查看更多
登录 后发表回答