“${PODS_ROOT}/SwiftLint/swiftlint” causes “Command PhaseScriptExecution failed with a nonzero exit code” with Xcode 10

送分小仙女□ 提交于 2019-11-27 20:27:40

问题


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


回答1:


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 :)




回答2:


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:


Some Framework or SDK require Code Signing.

I done code signing and resolved the problem for me.




回答4:


The pod that I was using was not updated for Xcode 10, so the solution that worked for me was to remove Cocoapods from my project and then installed again (the project was created on Xcode 9).

To remove it, the easiest way is:

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

After that, install the pods again.




回答5:


I just restarted my Macbook and it worked.




回答6:


For me adding arm64 architecture in "Build Setting -> valid architectures" resolved the issue.




回答7:


I had an authentication process (outside of Xcode) running in the background which seemed to be causing this issue for me. I had the keychain dialog up asking for my password. Solution was to restart the machine.




回答8:


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




回答9:


Restarting Xcode 10.1 fixed it for me; arose while updating Cocoapods ('RxSwift').




回答10:


In my case, Apple development certificate got expires.

To verify open Keychain -> My certificates -> check developer certificate is valid or not, If certificate is not valid then follow the below steps.

  • Open your apple developer account and create a new development certificate
  • Download and add it in your keychain.
  • Go to profiles and open your existing development profile and add the newly created certificate.
  • Download the fresh profile and install it.

Hope this helps you too.




回答11:


I had this issue on my ionic4 app after I have used cocoapods. My issue was that in Targets->Build Phases->Embed Pods Frameworks, I had a wrong path to Pods-MyApp-frameworks.sh script correcting that path solved the issue for me. Its because most of the time $PODS_ROOT variable doesn't set after installing pods




回答12:


Solution worked for me

I deleted all pod generated files and folders as listed below

  • Podfile.lock
  • Pods folder
  • ProjectName.xcworkspace

Again install pod for this project.

Now open .xcworkspace. Build and run...




回答13:


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.




回答14:


If you're getting

dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib

and a red

Command PhaseScriptExecution failed with a nonzero exit code

You should install the specific version of libreadline that you need

brew install readline
brew list --versions readline
brew switch readline 0.0.0



回答15:


If the directory where your project is has blank spaces that problem occurs To solve that problem add double quotes(""). For example:

"$(SRCROOT)/my framework/path"



来源:https://stackoverflow.com/questions/51174105/pods-root-swiftlint-swiftlint-causes-command-phasescriptexecution-failed-w

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!