Xcode 10 Command PhaseScriptExecution failed with a nonzero exit code (EXPANDED_CODE_SIGN_IDENTITY: unbound variable)
Asked Answered
T

16

32

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?

Tko answered 8/9, 2018 at 11:41 Comment(3)
Did you try Xcode 10 GM seed? Did you raise the issue on github.com/cocoapods/cocoapods/issues? What is a minimal Podfile that can reproduce your issue?Kaleidoscope
Related: github.com/CocoaPods/CocoaPods/issues/8000Kaleidoscope
#53290024Amias
J
25

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.

Joust answered 5/10, 2018 at 14:21 Comment(4)
Yeah, this fixed it for me. Kind of ridiculous that we need to use the beta release to avoid this issue. Hopefully they'll get the next stable release out quicklyShillelagh
1.6.0 stable was released two days ago: no need to install a beta version of CocoaPods anymore: sudo gem update cocoapods is enough now.Kaleidoscope
Before doing this laborious task try solution 3. Mines working for this. :)Polestar
This helps to ignore code signing for pods, but the code signing of the main mac app also needs to disable.Aircrewman
A
21

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.
Alumna answered 14/10, 2018 at 11:31 Comment(1)
Locking and unlocking the keychain fixed it for me. Either way, this fixes the issue with the password verification prompt.Schiedam
F
4

Some Framework or SDK require Code Signing.

I done code signing and resolved the similar problem for me. enter image description here

Fester answered 16/9, 2018 at 10:44 Comment(0)
U
2
EXPANDED_CODE_SIGN_IDENTITY: unbound variable
Command PhaseScriptExecution failed with a nonzero exit code

I had the same problem after updating BuildSettings and Podfile

I just restarted Xcode and opened a workspace - .xcworkspace (not project - .xcodeproj)

[Workspace vs Project]

Utoaztecan answered 2/8, 2019 at 10:51 Comment(1)
Worked - I had the Project file open, not the Workspace... :/Resonate
L
1

Go to pod folder and change the file as executable file. It works for me.

chmod +x filename

filename => your file name like "swiftlint"

Lurlinelusa answered 12/6, 2019 at 8:52 Comment(0)
C
1
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.

Carpel answered 20/11, 2019 at 10:44 Comment(1)
This worked for me on Xcode 12 beta 2 (Catalina) with Cocoapods v1.5.2 ! Thank you!Scrope
U
1

I had the same problem and could solve it, by just renaming the project. In my case this error was, because I had a ' symbol in my project name.

Underlying answered 11/2, 2020 at 22:56 Comment(0)
A
1
  • Delete the Pods directory and the Podfile.lock file.
  • Run pod install to re-create them from scratch.
  • Clean the Xcode project.
  • Build the Xcode project.
Ascogonium answered 9/3, 2020 at 5:20 Comment(0)
B
1

If you're on an M1/Apple Silicon Mac, make sure you have your Excluded Architectures set up properly. I don't know why this is necessary, but here's how you do it:

  1. Go to Build Settings
  2. Make sure you view "All" (default is "Basic")
  3. Expand "Excluded Architectures"
  4. Under debug, select Any iOS Simulator SDK, and add a value for "arm64"

Do the above settings for each relevant target, in my case I have "Pods", "Project", and then the iOS target.

enter image description here

Baelbeer answered 5/1, 2022 at 20:2 Comment(0)
P
0

Well, a simplepod install worked for me :)

Plumate answered 12/11, 2018 at 21:4 Comment(0)
B
0

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

Blotter answered 14/1, 2019 at 11:20 Comment(0)
A
0

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.!

Archimedes answered 17/4, 2019 at 16:44 Comment(0)
A
0

Restarting the mac helped me,not the xcode.

Ashleeashleigh answered 29/1, 2021 at 9:6 Comment(0)
L
0

Check the issue clearly, if it is related to swiftlint.yml then this hidden file must be present in your directory. If you are working on more than one module then you can copy and paste it from your other modules if any.

Lampblack answered 23/3, 2021 at 17:22 Comment(0)
M
0

nvm alias default 16.6.0 if you want it pegged to that specific version.

You can also do nvm alias default 16.

Modernize answered 8/1, 2022 at 14:11 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Pleasant
J
0

In My case, I tried many solutions but all in vain

Solution: I just do "Pod deintegrate" and then "pod install" then my project is working perfectly.

Javier answered 2/6, 2022 at 9:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.