Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed Pods Frameworks fails when target has spaces #3754

Closed
marcelofabri opened this issue Jul 1, 2015 · 37 comments
Closed

Embed Pods Frameworks fails when target has spaces #3754

marcelofabri opened this issue Jul 1, 2015 · 37 comments
Assignees
Milestone

Comments

@marcelofabri
Copy link
Contributor

🌈

I have a project with a target that has spaces on its name, so "Pods-{TARGET}" also contains spaces, which makes Embed Pods Frameworks phase to fail.

I think this was introduced on 0.38.0.beta.1, as this wasn't happening on 0.37.2. I also used pod deintegrate to make sure it wasn't an old configuration.

Here's the log:

PhaseScriptExecution Embed\ Pods\ Frameworks /Users/marcelofabri/Library/Developer/Xcode/DerivedData/Meu_Som-dazgsugpgdayalfcthkrbpsbjmby/Build/Intermediates/Meu\ Som.build/Debug-iphonesimulator/Meu\ Som.build/Script-CE9AC06B81CAD0645BD1B436.sh
    cd /Users/marcelofabri/Movile/meu-som-ios
    /bin/sh -c \"/Users/marcelofabri/Library/Developer/Xcode/DerivedData/Meu_Som-dazgsugpgdayalfcthkrbpsbjmby/Build/Intermediates/Meu\ Som.build/Debug-iphonesimulator/Meu\ Som.build/Script-CE9AC06B81CAD0645BD1B436.sh\"

mkdir -p /Users/marcelofabri/Library/Developer/Xcode/DerivedData/Meu_Som-dazgsugpgdayalfcthkrbpsbjmby/Build/Products/Debug-iphonesimulator/MeuShow.app/Frameworks
rsync -av --filter - CVS/ --filter - .svn/ --filter - .git/ --filter - .hg/ --filter - Headers --filter - PrivateHeaders --filter - Modules /Users/marcelofabri/Library/Developer/Xcode/DerivedData/Meu_Som-dazgsugpgdayalfcthkrbpsbjmby/Build/Products/Debug-iphonesimulator/Alamofire.framework /Users/marcelofabri/Library/Developer/Xcode/DerivedData/Meu_Som-dazgsugpgdayalfcthkrbpsbjmby/Build/Products/Debug-iphonesimulator/MeuShow.app/Frameworks
building file list ... done
Alamofire.framework/
Alamofire.framework/Alamofire
Alamofire.framework/Info.plist

sent 948859 bytes  received 70 bytes  1897858.00 bytes/sec
total size is 948506  speedup is 1.00
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool: can't open file: /Users/marcelofabri/Library/Developer/Xcode/DerivedData/Meu_Som-dazgsugpgdayalfcthkrbpsbjmby/Build/Products/Debug-iphonesimulator/MeuShow.app/Frameworks/Pods-Meu.framework/Pods-Meu (No such file or directory)

Workaround: If I use the link_with directive and create a target with no spaces, the problem doesn't happen.

@orta
Copy link
Member

orta commented Jul 1, 2015

Can confirm, I had the exact same problem.

@orta
Copy link
Member

orta commented Jul 1, 2015

When I added logging lines it was dying here:

  local swift_runtime_libs
  swift_runtime_libs=$(xcrun otool -LX "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/${basename}.framework/${basename}" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u  && exit ${PIPESTATUS[0]})

But it was not sending over the all the frameworks over, my build script looked like: https://gist.github.com/orta/94d1c72127738c61cd4a

@orta
Copy link
Member

orta commented Jul 1, 2015

Using gem 'cocoapods', :git => "https://github.com/cocoapods/cocoapods.git", :branch => "seg-embed-frameworks-quotes" in my Gemfile fixed this. I can build and link my test target "Artsy Tests" 👍

@segiddins segiddins self-assigned this Jul 1, 2015
@segiddins segiddins added this to the 0.38 milestone Jul 1, 2015
@soffes
Copy link

soffes commented Jul 23, 2015

I'm having the same issue with FastImageCache 1.3. I tried that branch @orta recommended and it fails to pod install:

NoMethodError - undefined method `predictabilize_uuids' for #<Pod::Project:0x007ffdbaac2f00>
/Users/ssoffes/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/cocoapods-119c8c765941/lib/cocoapods/installer.rb:635:in `block in write_pod_project'
/Users/ssoffes/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/cocoapods-119c8c765941/lib/cocoapods/user_interface.rb:140:in `message'
/Users/ssoffes/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/cocoapods-119c8c765941/lib/cocoapods/installer.rb:630:in `write_pod_project'
/Users/ssoffes/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/cocoapods-119c8c765941/lib/cocoapods/installer.rb:147:in `block in generate_pods_project'
/Users/ssoffes/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/cocoapods-119c8c765941/lib/cocoapods/user_interface.rb:59:in `section'
/Users/ssoffes/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/cocoapods-119c8c765941/lib/cocoapods/installer.rb:141:in `generate_pods_project'
/Users/ssoffes/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/cocoapods-119c8c765941/lib/cocoapods/installer.rb:101:in `install!'
/Users/ssoffes/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/cocoapods-119c8c765941/lib/cocoapods/command/project.rb:71:in `run_install_with_update'
/Users/ssoffes/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/cocoapods-119c8c765941/lib/cocoapods/command/project.rb:101:in `run'
/Users/ssoffes/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/claide-0.8.2/lib/claide/command.rb:312:in `run'
/Users/ssoffes/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/cocoapods-119c8c765941/lib/cocoapods/command.rb:48:in `run'
/Users/ssoffes/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/cocoapods-119c8c765941/bin/pod:44:in `<top (required)>'
/Users/ssoffes/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bin/pod:23:in `load'
/Users/ssoffes/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bin/pod:23:in `<main>'

Podfile:

source 'https://github.com/CocoaPods/Specs'

use_frameworks!

pod 'Helpshift'
pod 'FastImageCache'
pod 'TZStackView', :git => 'https://github.com/soffes/TZStackView.git', :commit => '52b2cd304ce5933ce327dcfca6d37dbd7e247391'

@orta
Copy link
Member

orta commented Jul 23, 2015

This is fixed in 0.38, but if you really want to not update CocoaPods - you can be sneaky.

@segiddins
Copy link
Member

@Isuru-Nanayakkara that's a separate issue, and the error there is printed:

/usr/bin/codesign --force --sign B4CCDAAEB967523A9DAE4CAC7FE8EC85F281C86D --preserve-metadata=identifier,entitlements "/Users/Admin/Library/Developer/Xcode/DerivedData/<project name>-eehjmypaobozaagxjxqvyqejvopt/Build/Products/Debug-iphoneos<project name>.app/Frameworks/Alamofire.framework"
B4CCDAAEB967523A9DAE4CAC7FE8EC85F281C86D: no identity found

@ndmeiri
Copy link

ndmeiri commented Aug 12, 2015

I'm getting this same error in Xcode 7 beta 5 with CocoaPods version 0.38.2. I've tried the suggestions above, but to no avail. Any other suggestions?

@sarbogast
Copy link

I'm also getting this error with CocoaPods 0.38.2 in XCode 7 beta 5 when trying to build a brand new project where I added Alamofire 2.0.0-beta1. And I don't have any targets with spaces in them.

PhaseScriptExecution Embed\ Pods\ Frameworks /Users/sarbogast/Library/Developer/Xcode/DerivedData/Build/Intermediates/DevoxxOnWrist.build/Debug-iphonesimulator/DevoxxOnWrist.build/Script-E4219B9168D71C0423C28FF9.sh
    cd /Users/sarbogast/dev/devoxx15/DevoxxOnWrist
    /bin/sh -c /Users/sarbogast/Library/Developer/Xcode/DerivedData/Build/Intermediates/DevoxxOnWrist.build/Debug-iphonesimulator/DevoxxOnWrist.build/Script-E4219B9168D71C0423C28FF9.sh

mkdir -p /Users/sarbogast/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/DevoxxOnWrist.app/Frameworks
rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/sarbogast/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/Pods/Alamofire.framework" "/Users/sarbogast/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/DevoxxOnWrist.app/Frameworks"
building file list ... done

sent 94 bytes  received 20 bytes  228.00 bytes/sec
total size is 0  speedup is 0.00
error: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool: can't open file: /Users/sarbogast/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/DevoxxOnWrist.app/Frameworks/Alamofire.framework/Alamofire (No such file or directory)

@adnan-SM
Copy link

I can confirm the same. I get the exact same error as @sarbogast running CocoaPods 0.38.2 in XCode7 beta 5 and using Alamofire 2.0.0-beta1. I don't have spaces either

@nPn-
Copy link

nPn- commented Sep 8, 2015

I think I am seeing the same issue, CoccoaPods 0.38.2, XCode7-beta6, Alamofire 2.0.0-beta4, Is there a solution/ workaround?

@nPn-
Copy link

nPn- commented Sep 8, 2015

Actually I don't think my problem had anything to do with CoccoaPods. I think deleting the derived data for xcode seemed to solve this for me

@marcioadr88
Copy link

Deleting the derived data worked for me too

@katsuma
Copy link

katsuma commented Sep 21, 2015

I also got the same error in CocoaPods 0.39.0.beta.4 and Xcode 7.0.
But rm -rf ~/Library/Developer/Xcode/DerivedData solved it for me. 👍 ✨

@octplane
Copy link

Thanks @katsuma (and @nPn- ), It fixed my project!

@dskatz22
Copy link

dskatz22 commented Oct 7, 2015

@segiddins im having an issue with the same failure as mentioned in your comment,
"no identity found" but dont see any context around it. Is there a specific solution around archive code signing failures with that specific error?

@adams3
Copy link

adams3 commented Oct 7, 2015

Also working for me, thanks @katsuma

@SamDavies
Copy link

thanks @katsuma, this also fixed it for me

@sgammon
Copy link
Contributor

sgammon commented Nov 11, 2016

anybody experiencing this issue with version 1.2.0.beta.1?
it's failing for me in {target}-frameworks.sh during:
code_sign_if_enabled "${destination}/$(basename "$1")"

@monmonja
Copy link

Same with @sgammon im having problem with space on code signing

@freak4pc
Copy link

I am failing as well with that version. What changed between the old version?

@freak4pc
Copy link

freak4pc commented Nov 13, 2016

Falling back to 1.1.1 doesn't seem to solve it.

Tried
sudo gem install cocoapods
pod deintegrate && pod install

Edit:
For now a good fix seems like wrapping "$1" with quotes to allow spaces inside the path.

e.g.
local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '"$1"'"

(You need to do this for both regular and test targets)

@sgammon
Copy link
Contributor

sgammon commented Nov 14, 2016

@freak4pc I've got a pull with some of those changes, could you give it a shot in your environment? it's #6160. happy to give you edit access if you have feedback :)

@davis503525
Copy link

Yeah I'm having this same issue now too - Xcode 8.1 and Cocoapods 1..2.0.beta.1

@lemonkey
Copy link

lemonkey commented Nov 16, 2016

Arg.. I had to end up upgrading to 1.2.0.beta.1 to fix a pod install 'abort trap 6' error I had after I added a new build configuration after upgrading to macOS Sierra and Xcode 8.1 only to be hit with a new "bug" that was ok previously.

Error happens during [CP] Embed Pods Frameworks since my app name has a space in it. This didn't used to be a problem..

@lemonkey
Copy link

lemonkey commented Nov 16, 2016

v1.0.1:

/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1"

v1.2.0.beta1:

local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1""

if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
  code_sign_cmd="$code_sign_cmd &"
fi

@lemonkey
Copy link

lemonkey commented Nov 16, 2016

I can confirm the single quote wrap mentioned by @freak4pc fixes my problem:

local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '"$1"'"

@calosth
Copy link

calosth commented Nov 16, 2016

@lemonkey works for me too. My app has a space in the name. Thanks @freak4pc

@Amindv1
Copy link

Amindv1 commented Dec 8, 2016

@freak4pc I'm confused, where exactly is this code_sign_cmd ? I looked in Target->myTarget->BuildPhases and I'm not seeing it under embed pods framework. Where exactly do I change this?

@Amindv1
Copy link

Amindv1 commented Dec 8, 2016

For anyone that's wondering, the line:

local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '"$1"'"

is located inside:

YourProject/Pods/Target\ Support\ Files/Pods-YourProject/Pods-YourProject-frameworks.sh
YourProject/Pods/Target\ Support\ Files/Pods-YourProjectTests/Pods-YourProject\ Tests-frameworks.sh

@Gerst20051
Copy link

YourProject/Pods/Target\ Support\ Files/Pods-YourProject/Pods-YourProject-frameworks.sh
YourProject/Pods/Target\ Support\ Files/Pods-YourProjectTests/Pods-YourProject\ Tests-frameworks.sh

@fulldecent
Copy link
Contributor

This issue should be marked as reopened.

@endocrimes
Copy link
Member

@fulldecent @freak4pc If this is a regression, it should be filed a new issue.

@joeboyscout04
Copy link

Looks like a regression to me. New issue:

#6294

should be reopened.

@felixdkatt
Copy link

Yes seeing it still using latest stable version
'"$1"'" fixes it locally.

@benasher44
Copy link
Member

@felixdkatt it's fixed in 1.2.0.beta.3

@felixdkatt
Copy link

Oh great thanks Ben

@bastianbecker21
Copy link

Thanks.
'"$1"'" worked for me in cocoapods 1.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests