问题
This error pops up when doing Project > Test
/Users/.../Project/Pods/Target Support Files/Pods-Target/Pods-TargetTests-frameworks.sh:
line 104: EXPANDED_CODE_SIGN_IDENTITY: unbound variable
Command PhaseScriptExecution failed with a nonzero exit code
How do I resolve "Command PhaseScriptExecution failed with a nonzero exit code" error when trying to test a project with cocoapods?
回答1:
This helped me
sudo gem install cocoapods --pre
pod update
I've read BugReport. Problem was similar to mine and it was fixed in 1.6.0.beta.1 (2018-08-16) (changelog).
Updated(thanks to Cœur)
1.6.0 (2019-02-07) Was published
sudo gem update cocoapods
This should work now.
回答2:
I have facing the same issue, i believe this issue have something link to keychain access too (code signing problem), I go to keychain access unlock the login then lock it again fixed this issue. After uploading toOSMojave and Xcode 10 keychain need to reverify the password. (how i find this? while facing same issue and trying all available option, i think to generate certificate again, but while generating private key i found keychain login user name and password is wrong type of message- i lock and unlock again solved my problem). Note this process required your login pass phare.
How to fix:- short tip
Go to keychain access -> right click on login -> lock & unlock again
-> clear Xcode project and make build again.
回答3:
Some Framework or SDK require Code Signing.
I done code signing and resolved the similar problem for me.
回答4:
Well, a simplepod install
worked for me :)
回答5:
Go to pod folder and change the file as executable file. It works for me.
chmod +x filename
filename => your file name like "swiftlint"
回答6:
I had the same problem after updating BuildSettings and pod file.
I just restarted Xcode and open a workspace
回答7:
I've had the same problem. It turns out that by switching between Xcode9 and Xcode10 sometimes it can happen that the command line tools used for building can be switched so I was trying to build it with 9.4 command line tool instead of 10 which caused the issue.
Going to preferences and setting the command line tool to the right one fixed the issue for me.
Another thing that helped me is to disable and enable iCloud again. (Not sure why.)
回答8:
Ive been dealing with this issue for a couple of days now. What did it for me was.
-Update cocoapods to the last version
-Update all pods
-Opening keychain access and delete the key made by xcode (with xcode closed)
-Opening Xcode will recreate a new key and will ask you for the password.
-After this I cleaned and built and the application ran on my physical device.
I hope this is helpful since its a very annoying bug.!
回答9:
On the top of - Pods-yourProjectName-frameworks.sh
export EXPANDED_CODE_SIGN_IDENTITY=""
export EXPANDED_CODE_SIGN_IDENTITY_NAME=""
export EXPANDED_PROVISIONING_PROFILE=""
this is an issue with pod update.
来源:https://stackoverflow.com/questions/52234957/xcode-10-command-phasescriptexecution-failed-with-a-nonzero-exit-code-expanded