Open lzzhang75 opened 4 years ago
I had the same problem. The script that copies dsym files copies symlinks as symlinks(rsync -av). But since dysm files that are created by cocoapods-binary
are symlink files. So changing copy script to 'copy actual files not symlinks' resolves the problem. I don't have much experience on ruby and cocoapods but I come up with the following script.
Add this script to end of your Podfile
. Then delete your Pods
folder and run pod install
again
post_integrate do |installer|
installer.pods_project.targets.each do |target|
target.shell_script_build_phases.each do |phase|
script = phase.shell_script
if script.include? "-copy-dsyms.sh\""
script = script.delete_prefix "\"${PODS_ROOT}/"
script = script.delete_suffix "\"\n"
script = "Pods/" + script
contents = File.read(script)
contents = contents.gsub(/-av/, "-r -L -p -t -g -o -D -v")
File.open(script, "w") do |file|
file.puts contents
end
end
end
end
end
Thanks @mstfy that seems to be working for me as well.
I'm hitting this too. Thanks @mstfy for figuring out what went wrong.
I wonder what desired fix would be, what do you think @leavez ?
The fix above doesn't work for us 😞 We're stuck on v1.9.3. for several months now for this reason 🙈 Did anyone find other workarounds?
@rogerluan in case you have ruby 2.4.10 and get Undefined method delete_prefix for <String...>
It's maybe not the optimal way to fix this, but it fixes the error on our end
# script = script.delete_prefix "\"${PODS_ROOT}/"
# script = script.delete_suffix "\"\n"
#https://stackoverflow.com/a/30322598/6060623
script = script.reverse.chomp("\"${PODS_ROOT}/".reverse).reverse
script = script.chomp "\"\n"
BUT, a proper workaround would be better
Nope, we use Ruby 2.6.5~2.7.0 - thanks for the suggestion anyway though! @cnadeau
Thanks @mstfy for the script, the only one that worked for me.
But in my case, it's a mix of this script and
rm -rf ~/Library/Developer/Xcode/DerivedData
and remove the pod + install the pod again... And also checking the pods, because some, like Firebase don't work for me with :binary => true
I am getting the same error on my Azure pipeline. Nevermind, after clean build locally, it crashes too at the same place.
The following build commands failed: PhaseScriptExecution [CP]\ Copy\ dSYMs
use cocoapods-binary in
thanks, @mstfy, I change it for the following codes,it works for me
def change_copy_dsyms(installer)
installer.generated_projects.each do |project|
project.targets.each do |target|
target.shell_script_build_phases.each do |phase|
script = phase.shell_script
if script.include? "-copy-dsyms.sh\""
script = script.delete_prefix "\"${PODS_ROOT}/"
script = script.delete_suffix "\"\n"
script = "Pods/" + script
contents = File.read(script)
contents = contents.gsub(/-av/, "-r -L -p -t -g -o -D -v")
File.open(script, "w") do |file|
file.puts contents
end
end
end
end
end
end
post_integrate do |installer|
change_copy_dsyms(installer)
end
Got an error when trying CocoaPod 1.10.x-beta https://github.com/CocoaPods/CocoaPods/issues/10003
Here are the details. Would this be fixed to support CocoaPod 1.10.x?
Report
What did you do?
pod install
What did you expect to happen?
I expecte the xcode project can compile after the pod install
What happened instead?
CocoaPods Environment
Stack
Installation Source
Plugins
Podfile
Project that demonstrates the issue
unrelated
Additional Mote
v1.10.x added a build script "CocoaLumberjack-copy-dsyms.sh" when Precompiling is enabled. This script causes build error, as mentioned in the previous sections.
This new script wasn't in v1.9.3 when Precomiling was enabled using v1.9.3