Open kacper1703 opened 3 years ago
I have the same problem. Although I can use version 0.4.1 on an ad hoc basis.
What's the workaround for this? Due to this issue, I haven't been able to build my projects on Big Sur and Xcode 12.2 unless I remove precompiled pods.
Is the accepted workaround to just run gem uninstall cocoapods-binary
and then gem install cocoapods-binary -v 0.4.1
to downgrade to 0.4.1? That seems to work for me.
🙏
Yeah, kind of. I updated my Gemfile to this:
source 'https://rubygems.org'
gem 'cocoapods', '~> 1.10.0'
gem 'cocoapods-binary', '0.4.1'
Same issue here, but downgrading to 0.4.1 didn't help me...
You can fix this by hand ,for example
Pods/Target Support Files/AFNetworking/AFNetworking-copy-dsyms-output-files.xcfilelist
Delete duplicate lines,left only one line
${DWARF_DSYM_FOLDER_PATH}/AFNetworking.framework.dSYM
@kingnight nice yeah that works as well 🔥
Cumbersome to delete all duplicate lines in all output-files.xcfilelist
and input-files.xcfilelist
files, but surprised the issue was that simple.
If you want to fix this automatically you can put this in your Podfile
post_integrate do |installer|
patch_cocoapods_binary_dsyms(installer)
end
def patch_cocoapods_binary_dsyms(installer)
installer.generated_projects.each do |project|
project.targets.each do |target|
target.shell_script_build_phases.each do |phase|
phase.input_file_list_paths.each do |file_list_path|
dedupe_file_list(file_list_path)
end
phase.output_file_list_paths.each do |file_list_path|
dedupe_file_list(file_list_path)
end
end
end
end
end
def dedupe_file_list(file_list_path)
file_list_path = file_list_path.delete_prefix "${PODS_ROOT}"
file_list_path = File.join(PODS_DIR, file_list_path)
contents = File.readlines(file_list_path, chomp: true)
contents = contents.uniq
File.open(file_list_path, "w") do |file|
file.puts contents
end
end
besides the "Multiple commands produce" issue, there is a backslash missing in every *-copy-dsyms.sh file:
"${DERIVED_FILES_DIR}" => "${DERIVED_FILES_DIR}/"
Based on @scottasoutherland's code, I patched it with
def patch_cocoapods_binary_dsyms(installer)
installer.generated_projects.each do |project|
project.targets.each do |target|
target.shell_script_build_phases.each do |phase|
shell_file = phase.shell_script.strip.gsub!(/\A"|"\Z/, '').delete_prefix "${PODS_ROOT}"
shell_file = File.join("./Pods", shell_file)
shell_script = File.read(shell_file, chomp: true)
fixed_shell_script = shell_script.gsub("\"${DERIVED_FILES_DIR}\"", "\"${DERIVED_FILES_DIR}/\"")
File.open(shell_file, "w") do |f|
f.write(fixed_shell_script)
end
phase.input_file_list_paths.each do |file_list_path|
dedupe_file_list(file_list_path)
end
phase.output_file_list_paths.each do |file_list_path|
dedupe_file_list(file_list_path)
end
end
end
end
end
def dedupe_file_list(file_list_path)
file_list_path = file_list_path.delete_prefix "${PODS_ROOT}"
file_list_path = File.join("./Pods", file_list_path)
contents = File.readlines(file_list_path, chomp: true)
contents = contents.uniq
File.open(file_list_path, "w") do |file|
file.puts contents
end
end
post_integrate do |installer|
patch_cocoapods_binary_dsyms(installer)
end
I meet the same problem
I meet the same problem
having the same problem
Anybody found solution for this?
@dinghaoz Tried with your approach but im getting these errors.
[!] An error occurred while processing the post-integrate hook of the Podfile.
undefined method `delete_prefix' for nil:NilClass
/Users/my_username/Documents/Github/my_project/Podfile:164:in `block (3 levels) in patch_cocoapods_binary_dsyms'
/Users/my_username/Documents/Github/my_project/Podfile:162:in `each'
/Users/my_username/Documents/Github/my_project/Podfile:162:in `block (2 levels) in patch_cocoapods_binary_dsyms'
/Users/my_username/Documents/Github/my_project/Podfile:161:in `each'
/Users/my_username/Documents/Github/my_project/Podfile:161:in `block in patch_cocoapods_binary_dsyms'
/Users/my_username/Documents/Github/my_project/Podfile:160:in `each'
/Users/my_username/Documents/Github/my_project/Podfile:160:in `patch_cocoapods_binary_dsyms'
/Users/my_username/Documents/Github/my_project/Podfile:200:in `block (2 levels) in from_ruby'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/podfile.rb:213:in `post_integrate!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:973:in `run_podfile_post_integrate_hook'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:961:in `block in run_podfile_post_integrate_hooks'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:149:in `message'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:960:in `run_podfile_post_integrate_hooks'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:861:in `block in integrate_user_project'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:856:in `integrate_user_project'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-binary-0.4.4/lib/cocoapods-binary/helper/feature_switches.rb:64:in `call'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-binary-0.4.4/lib/cocoapods-binary/helper/feature_switches.rb:64:in `block in <class:Installer>'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:182:in `integrate'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:167:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
I think nil case is not handled in the code. Any idea?
@dinghaoz thanks, your solution worked for me as well.
Hi! @dinghaoz post_integrate script worked for me to solve most of the errors. Somehow there's one remaining one for me:
Multiple commands produce '/Users/ABCD/Library/Developer/Xcode/DerivedData/foo/Build/Products/Debug-iphonesimulator/foo.app/Pods-foo-metadata.plist'
Target 'foo' (project 'foo') has copy command from '/Users/ABCD/Developer/foo/Pods/Pods-foo-metadata.plist' to '/Users/ABCD/Library/Developer/Xcode/DerivedData/foo/Build/Products/Debug-iphonesimulator/foo.app/Pods-foo-metadata.plist'
Target 'foo' (project 'foo') has copy command from '/Users/ABCD/Developer/foo/Pods/_Prebuild/Pods-foo-metadata.plist' to '/Users/ABCD/Library/Developer/Xcode/DerivedData/foo/Build/Products/Debug-iphonesimulator/foo.app/Pods-foo-metadata.plist'
Any idea on how to fix it? 😕
For a following Podfile, when trying to build the project multiple errors appear. Excluding some of these frameworks using
:binary => false
does not help.Environment: