Cocoapods: 'PhaseScriptExecution failed with a nonzero exit code' when using a greek symbol in target

Created on 8 Apr 2018  ·  23Comments  ·  Source: CocoaPods/CocoaPods

Report

What did you do?

  • Update to CocoaPods 1.5.0
  • Run pod install
  • Compile an Xcode target containing a greek symbol (i.e MyApp α)

What did you expect to happen?

The project should build fine just as the other targets without greek symbols

What happened instead?

Targets that contain a greek symbols for alpha, beta etc (i.e MyTarget α) fails to build. This happens after upgrading to CocoaPods 1.5.0 to both my project and a friends of mine's project. Note that the targets that do NOT contain these symbols builds just fine.

Here is the output from the Xcode log:

PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/robertgummesson/Library/Developer/Xcode/DerivedData/MyApp-dtpdmysudmnqpmaebnnqioqurpnp/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp\ α.build/Script-23AEA06A0D32C5272020C7CA.sh
    cd /Users/robertgummesson/Development/MyApp
    /bin/sh -c /Users/robertgummesson/Library/Developer/Xcode/DerivedData/MyApp-dtpdmysudmnqpmaebnnqioqurpnp/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp\\\ \\α.build/Script-23AEA06A0D32C5272020C7CA.sh

mkdir -p /Users/robertgummesson/Library/Developer/Xcode/DerivedData/MyApp-dtpdmysudmnqpmaebnnqioqurpnp/Build/Products/Debug-iphonesimulator/MyApp α.app/Frameworks
/Users/robertgummesson/Development/MyApp/Pods/Target Support Files/Pods-MyApp α/Pods-MyApp α-frameworks.sh: line 38: source: unbound variable
Command PhaseScriptExecution failed with a nonzero exit code

CocoaPods Environment

Stack

   CocoaPods : 1.5.0
        Ruby : ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin17]
    RubyGems : 2.6.13
        Host : Mac OS X 10.13.4 (17E199)
       Xcode : 9.3 (9E145)
         Git : git version 2.15.1 (Apple Git-101)
Ruby lib dir : /usr/local/Cellar/ruby/2.4.2/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 32fa746c8f61cbb733acaec33509b1f2995e45a8
               PodSpecs - [email protected]:RobertGummesson/PodSpecs.git @ 2cbe6113f45425f5ab48690b6cb410270d270ef1
               robertgummesson - https://github.com/RobertGummesson/PodSpecs.git @ 2cbe6113f45425f5ab48690b6cb410270d270ef1

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-deintegrate : 1.0.2
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.3.0
cocoapods-try         : 1.1.0

Podfile

platform :ios, '11.3'
use_frameworks!use_frameworks!

def pods
    pod 'DeviceKit'
    pod 'DAKeychain'
end

target 'CocoaPods' do
    pods
end

target 'CocoaPods α' do
    pods
end

Project that demonstrates the issue

UPDATE: The problem can't be reproduced in this sample project despite containing the same symbol for the target name. Unfortunately I don't know how to reproduce it from a blank project. All I have is 2 larger projects which I can't share that has this issue. Also see the comment further down.

https://github.com/RobertGummesson/CocoaPods-BugDemo

need sample defect

Most helpful comment

My friend (who also experienced this issue) worked out how to work around this problem. Here is how:

1) Go to General, then under Linked Frameworks and libraries, delete the Pods framework and add it back.
2) Clean the project
3) Compile again and it will work.

Feel free to close the issue but again, v1.4.0 could handle this while v1.5.0 couldn't.

All 23 comments

I was able to reproduce it in a blank project now. The ticket has been updated.

How should I be building the sample project to reproduce the issue?

@segiddins

  • Download or clone it
  • Change the scheme to CocoaPods α
  • Build the project

I actually note now that the compiler error for the sample project is not the same as the one I get in my main project. Hmmm... Let me try to look closer when I have a moment otherwise there is a risk that the sample project is misleading. I can't really post the main project and I don't know how else to reproduce it.

For the record, when I reverted back to CocoaPods 1.4.0, my main project started building fine again.

I just corrected the sample project and unfortunately I can't reproduce the problem there. Now my hopes is that the error message alone would give someone here a hint what the issue could be.

Again, this problem happens for two different projects I am involved in and in both cases, the target names that don't include the symbols α and β (alpha and beta) build just fine.

My friend (who also experienced this issue) worked out how to work around this problem. Here is how:

1) Go to General, then under Linked Frameworks and libraries, delete the Pods framework and add it back.
2) Clean the project
3) Compile again and it will work.

Feel free to close the issue but again, v1.4.0 could handle this while v1.5.0 couldn't.

We’re happy to look into the issue, we just need a way to reproduce it

Yes, unfortunately both of these projects are production code which can't be shared. Given I couldn't reproduce it in a blank project, perhaps this is as far as we can get with this issue?

I'm closing this with an "can't reproduce" state.

I'm also experimenting this issue @RobertGummesson .
Project created with Cocoapods older than 1.3.5
Pre Xcode10 worked

After Xcode10 get the error
It happens on running custom shell script [CP] Embed Pods Frameworks

First fix: nuked cocoapods generated frameworks + workspace + .lock + update cocoapods + regenerate the project -> works for build + run

Problem: Fails when running tests (same error). I ran out of ideas there.
Additional: When doing the suggested trick Robert mentions, the Pod frameworks shows as shadowed (I'll attach a screenshot). Not sure it should do that.

Basically ran out of ideas to try

screen shot 2018-09-19 at 17 20 32
screen shot 2018-09-19 at 17 20 16

I have a reliable way reproduce this problem now. When I have time, I will file a new bug for this. In my case, the problem is that CocoaPods can't handle my target with the α-symbol after a pod install. It inserts a Pods_MyApp___ under Build Phases/Link Binary With Libraries. However, there is already one called Pods_MyApp_α in there. Removing the invalid library after each pod install fixes the problem.

In XCode 10 I deleted and re-added pods_MAINTARGERNAME.framework from main project but didnt work.
So I closed XCode 10. opened project n XCode 9 and pod.framework was missing so added it there.
built ok after that in XCode 9 but when I returned to XCode 10 error returned. oh well wait for Xcode 10.11 to be sure :)

@clearbrian I fixed it nuking the Pods project, then recreating it + marking Build active frameworks to yes on both tests + normal targets (on Debug). That worked (there's a link on github but I lost it, not sure where I can get all my github comments)

Happening for me too.

@clearbrian I fixed it nuking the Pods project, then recreating it + marking Build active frameworks to yes on both tests + normal targets (on Debug). That worked (there's a link on github but I lost it, not sure where I can get all my github comments)

This fixed it for me too (+1)
P.S
Check Manage schemes... > [] Shared is unticked and if it helps.

I fixed this by updating my cocoapods to 1.6.0 beta 2.
1 - sudo gem install cocoapods --pre
2 - pod update
3 - clean and build the project in Xcode

Report

It is a new project and no other code has been added yet.I encountered the same problem when I used use_frameworks!,I didn't have this problem after removing use_frameworks!.

Xcode build log

EXPANDED_CODE_SIGN_IDENTITY: unbound variable
Command PhaseScriptExecution failed with a nonzero exit code

CocoaPods Environment

Stack

   CocoaPods : 1.5.3
        Ruby : ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
    RubyGems : 2.5.2.3
        Host : Mac OS X 10.14.2 (18C54)
       Xcode : 10.1 (10B61)
         Git : git version 2.17.2 (Apple Git-113)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ b1a74be5f10cf92b82849285b1d820e7fd6ccf7c

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-deintegrate : 1.0.2
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.3.1
cocoapods-try         : 1.1.0

Podfile

# Uncomment the next line to define a global platform for your project
platform :osx, '10.12'

target 'DesktopIMDemo' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!

  # Pods for DesktopIMDemo
  pod 'CocoaAsyncSocket'
  pod 'Protobuf'
end

Anyway which Framework I want to add I got this error

PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/helming/Library/Developer/Xcode/DerivedData/Test-atukyjdsmmgqfngysibqxqjdvxgy/Build/Intermediates.noindex/Test.build/Debug-iphoneos/Test.build/Script-558DDD19D308482FAA250B75.sh (in target: Test)
    cd /Users/helming/Documents/Projekte/Spielwiese/Test
    /bin/sh -c /Users/helming/Library/Developer/Xcode/DerivedData/Test-atukyjdsmmgqfngysibqxqjdvxgy/Build/Intermediates.noindex/Test.build/Debug-iphoneos/Test.build/Script-558DDD19D308482FAA250B75.sh

mkdir -p /Users/helming/Library/Developer/Xcode/DerivedData/Test-atukyjdsmmgqfngysibqxqjdvxgy/Build/Products/Debug-iphoneos/Test.app/Frameworks
rsync --delete -av --filter P .*.?????? --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/helming/Library/Developer/Xcode/DerivedData/Test-atukyjdsmmgqfngysibqxqjdvxgy/Build/Products/Debug-iphoneos/FLKAutoLayout/FLKAutoLayout.framework" "/Users/helming/Library/Developer/Xcode/DerivedData/Test-atukyjdsmmgqfngysibqxqjdvxgy/Build/Products/Debug-iphoneos/Test.app/Frameworks"
building file list ... done
FLKAutoLayout.framework/
FLKAutoLayout.framework/FLKAutoLayout
FLKAutoLayout.framework/Info.plist

sent 135518 bytes  received 70 bytes  271176.00 bytes/sec
total size is 135262  speedup is 1.00
dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib
  Referenced from: /usr/local/bin/awk
  Reason: image not found
Command PhaseScriptExecution failed with a nonzero exit code
Showing Recent Messages
 mkdir -p /Users/helming/Library/Developer/Xcode/DerivedData/Test-atukyjdsmmgqfngysibqxqjdvxgy/Build/Products/Debug-iphoneos/Test.app/Frameworks

rsync --delete -av --filter P .*.?????? --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/helming/Library/Developer/Xcode/DerivedData/Test-atukyjdsmmgqfngysibqxqjdvxgy/Build/Products/Debug-iphoneos/FLKAutoLayout/FLKAutoLayout.framework" "/Users/helming/Library/Developer/Xcode/DerivedData/Test-atukyjdsmmgqfngysibqxqjdvxgy/Build/Products/Debug-iphoneos/Test.app/Frameworks"

building file list ... done

FLKAutoLayout.framework/

FLKAutoLayout.framework/FLKAutoLayout

FLKAutoLayout.framework/Info.plist



 sent 135518 bytes  received 70 bytes  271176.00 bytes/sec

total size is 135262  speedup is 1.00

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

Referenced from: /usr/local/bin/awk

Reason: image not found

Command PhaseScriptExecution failed with a nonzero exit code


I was able to reproduce it when receiving a project built with case sensitive OS while mine is not case sensitive. There was some mess up with the cases in the file names and folders. After fixing them everything worked fine.

@segiddins
I have integrated Firebase and GoogleTagManager into my iOS app target using Cocoapods. When I build my target, Xcode constantly gives me error:

Showing Recent Messages
PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks 

mkdir -p /Users/xxx.xxx/Library/Developer/Xcode/DerivedData/MyApp-enzvpdzsyhjszqbnwiclnpszlyri/Build/Products/Debug-iphonesimulator/MyApp.app/Frameworks


/Users/xxx.xxx/Projects/MyApp/Applications/MyApp/Pods/Target Support Files/Pods-MyApp/Pods-MyApp-frameworks.sh: line 43: source: unbound variable


Command /bin/sh failed with exit code 1

I've cleaned my project multiple times, deleted the derived data folder but none of these seem to work.

My Podfile looks like this:

platform :ios, '11.0'

target 'MyApp' do

  use_frameworks!

  # Pods for MyApp
    pod 'Firebase/Core', '~> 5.19'
    pod 'Firebase/ABTesting'
    pod 'Firebase/Performance'
    pod 'Firebase/RemoteConfig'
    pod 'Firebase/Analytics'
    pod 'GoogleTagManager', '~> 7.1'
 end

Cocoapods Environment

CocoaPods : 1.6.1
        Ruby : ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
    RubyGems : 2.6.8
        Host : Mac OS X 10.14 (18A391)
       Xcode : 10.1 (10B61)
         Git : git version 2.17.2 (Apple Git-113)
Ruby lib dir : /Users/xxx.xxx/.rbenv/versions/2.4.0/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 7c9a708dce25221eabc35ed39

What is it that I am missing in my project settings that is causing this error ?

I have spent several days looking for a solution on SO / Cocoapods but in vain.

Any help in this regards would be really appreciated.

delete previous pods install pod then run update pod .

Perform the below steps:

Clean the build.
Go to File -> Workspace Settings
In shared workspace settings select "Legacy Build System" in Build System.
Now try to build and run.

Wouldn't recommend using Legacy Build System as a proper fix.

Hi, I'm facing this issue too. Someone has solution on this issue?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Mingmingmew picture Mingmingmew  ·  3Comments

pallaviMN picture pallaviMN  ·  3Comments

sonu5 picture sonu5  ·  3Comments

gerchicov-bp picture gerchicov-bp  ·  3Comments

evermeer picture evermeer  ·  3Comments