Cocoapods: Product with single quotes in name fails to build

Created on 29 Sep 2017  路  6Comments  路  Source: CocoaPods/CocoaPods

Report

What did you do?

Run pod install using version 1.2 or later (currently using 1.3.1)
Attempt to build, observe failure

What did you expect to happen?

Build success

What happened instead?

Build fails with > Pods-OBF/Pods-OBF-frameworks.sh: eval: line 81: unexpected EOF while looking for matching `''

Workarounds

Go to line 81, replace '$1' with \"$1\"

Appears to be introduced here: https://github.com/CocoaPods/CocoaPods/commit/787813313fa8628801387d32a426b80363e178b8

awaiting input

Most helpful comment

@Rajveer86 I've updated the Podfile for the project that experiences this issue to contain the following, so that I don't have to manually update my file after running pod install:

post_install do |installer|
    text = File.read("Pods/Target Support Files/Pods-Project/Pods-Project-frameworks.sh")
    new_contents = text.gsub(/'\$1'/, "\\\"$1\\\"")

    File.open("Pods/Target Support Files/Pods-Project/Pods-Project-frameworks.sh", "w") {|file| file.puts new_contents}
end

@dnkoutso I haven't had the time to look into providing a fix inside CocoaPods. We are satisfied with the workaround here.

All 6 comments

@jordanperry want to provide a PR that fixes this including tests? Careful though because this change happened on purpose to fix another issue which I do not recall and I need to dig up for you.

I too am experiencing this and the workaround fixes this for me (although '$1' appears on line 75 for me, not 81).

@Rajveer86 I've updated the Podfile for the project that experiences this issue to contain the following, so that I don't have to manually update my file after running pod install:

post_install do |installer|
    text = File.read("Pods/Target Support Files/Pods-Project/Pods-Project-frameworks.sh")
    new_contents = text.gsub(/'\$1'/, "\\\"$1\\\"")

    File.open("Pods/Target Support Files/Pods-Project/Pods-Project-frameworks.sh", "w") {|file| file.puts new_contents}
end

@dnkoutso I haven't had the time to look into providing a fix inside CocoaPods. We are satisfied with the workaround here.

@jordanperry Thank you for posting your post_install script, that works perfectly for me!

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem :+1:

Was this page helpful?
0 / 5 - 0 ratings