Set up a pod that vendors a binary framework (e.g. Library.framework
) and a dSYM artifact (e.g. Library.framework.dSYM
).
Set up a project that has a unit test target without a host application.
Run pod install
.
Built the unit test target for testing.
Compiling succeeds and dependency is available in both main target and unit test target.
Compiling fails because:
Multiple commands produce '/Users/Adrian/Library/Developer/Xcode/DerivedData/Demo/Build/Products/Debug-iphonesimulator/Library.framework.dSYM':
1) That command depends on command in Target 'Demo' (project 'Demo'): script phase â[CP] Embed Pods Frameworksâ
2) That command depends on command in Target 'DemoTests' (project 'Demo'): script phase â[CP] Embed Pods Frameworksâ
Setting a test host for the unit test target makes it work.
Switching to the legacy build system makes it work.
Adding disable_input_output_paths: true
option makes it work.
CocoaPods : 1.8.0
Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
RubyGems : 3.0.3
Host : Mac OS X 10.14.6 (18G95)
Xcode : 11.0 (11M392r)
Git : git version 2.23.0
Ruby lib dir : /Users/Adrian/.rbenv/versions/2.6.3/lib
Repositories : master - git - https://github.com/CocoaPods/Specs.git @ aff37984f83a304d8f1f3c5bd909f8f377617acc
Executable Path: /Users/Adrian/.rbenv/versions/2.6.3/bin/pod
cocoapods-deintegrate : 1.0.4
cocoapods-keys : 2.1.0
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-stats : 1.1.0
cocoapods-trunk : 1.4.0
cocoapods-try : 1.1.0
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
def shared_pods
pod "Kingfisher", podspec: "./Kingfisher/Kingfisher.podspec"
end
target 'Demo' do
shared_pods
end
target 'DemoTests' do
shared_pods
end
Attached: 15589-9.0.0-ios.zip. The archive consists of:
Demo.xcodeproj
that has the set up described above.Kingfisher.framework
and .dSYM
used by Podfile
.Hm maybe a bug but thanks for the report and sample app! If its identified to be an issue we can fix it for 1.8.1 release.
It's because your DemoTests
depends on DemoApp
but it does not use it as its app host as you said initially.
You can also remove the DemoApp
dependency from the 'Dependencies' phase in your DemoTests
target.
I understand that the workarounds... work. đ
But target dependency only describes which targets are built _before_ the current one. Having a unit test target without a test host is a valid setup that should be supported while using xcfilelists.
This setup _is_ supported for open source pods that don't have the need to define dSYMs in preserve_paths
. It only breaks if there's a dSYM. That's why I believe it's an issue in file lists generated by CocoaPods.
Its probably a bug yes in CocoaPods. we need to detect if the dependency is set but _not_ the app host.
It seems Xcode does not complain in the case in which the app host is set...this will require a change in CocoaPods to detect that case.
This started happening for me on the xcode 11.
In build phases, we have custom fonts included in Copy Bundle Resources and we also had them as input and output files in Copy Pods Resources. In order for the build to work, we have to remove them from Copy Pods Resources, but Pod install/update re-adds them here.
This started happening for me on the xcode 11.
In build phases, we have custom fonts included in Copy Bundle Resources and we also had them as input and output files in Copy Pods Resources. In order for the build to work, we have to remove them from Copy Pods Resources, but Pod install/update re-adds them here.
We have same problem.
I do not think the last two comments are the same issue. Rather a different one and possibly a misconfiguration of the project.
For the original issue this is definitely confirmed. We use ${DWARF_DSYM_FOLDER_PATH}/Kingfisher.framework.dSYM
for the output path of each dSYM because that is where Xcode copies dSYMs
too. It seems that this is triggered as long as the test target does not use the target app as its app host.
I've hit a similar issue in a bit different setup. So I have an app target (App
) that has the following dependencies:
B
, a developmeent pod with a vendored framework and dSYM.A
, a development pod that also depends on B
and has a hostless test spec.Here's the error message:
Multiple commands produce '/path/to/Build/Products/Debug-iphonesimulator/B.framework.dSYM':
1) That command depends on command in Target 'A-Unit-Tests' (project 'Pods'): script phase â[CP] Embed Pods Frameworksâ
2) That command depends on command in Target 'App' (project 'App'): script phase â[CP] Embed Pods Frameworksâ
We have a very difficult non trivial project structure and use cocoapods-binary plugin.
In case of deactivation cocoapods-binary this issue are not reproduced for our project.
But cocoapods-binary are very useful for us and I solve issue by running script right after pod install
#!/bin/bash -l
set -e
set -o pipefail
full_local_path=$(dirname "$0")
for pfx in "Pods-UIKitDemo" "Pods-Settings" "*TestApp" "*Tests"; do
find $full_local_path/../Pods -type f -name "$pfx-frameworks-Debug-output-files.xcfilelist" -exec sed -E -i '' '/.*framework\.dSYM$/d' {} \;
done
This script are not universal.
If you want to use it you should change string for pfx in "Pods-UIKitDemo" "Pods-Settings" "*TestApp" "*Tests"; do
For me (Xcode 11.3.1, CP 1.8.4) switching to "Legacy Build System" in workspace settings fixes the build issue but requires me to switch to the system each time I want to run tests. This is really troublesome.
We investigated the issue further, this is actually a much more complex change so it will have to be in 1.10.0 release.
The issue here is that CocoaPods treats dSYMs as if they were frameworks during the embedding stage versus all that is needed is to just copy the vendored dSYM into the Products dir.
I am re-implemeting this from scratch and will have a PR soon.
Work in progress here https://github.com/CocoaPods/CocoaPods/pull/9547
@akashivskyy can you try #9547 ?
@dnkoutso I confirm that the sample project I attached now builds with #9547. Thank you! â¤ď¸
awesome! Thanks @akashivskyy! I pushed another update to the branch that fixed a critical issue with xcfilelists and output paths. This should land today (PST timezone)
One more follow up to use DWARF_DSYM_FOLDER_PATH
instead https://github.com/CocoaPods/CocoaPods/pull/9552. This ensures again dSYMs are copied correctly for archiving.
@akashivskyy can you try #9547 ?
sorry just want to asking, how i implement this one?
@dnkoutso Now that 1.10 is released has this been fixed?
Looks like closed and marked for this release so it should be yes.
Seeing this issue with similar setup to @navartis, using binary in prebuild because Firebase and other google pods are massive (15-20 min) compile times
With cocoapods-binary I get
Multiple commands produce '/Users/felip/Library/Developer/Xcode/DerivedData/CashBack-cuszxqnldfepigfapfsmaoloyjan/Build/Products/Debug-iphoneos/GTMSessionFetcher/GTMSessionFetcher.framework.dSYM':
1) That command depends on command in Target 'GTMSessionFetcher' (project 'Pods'): script phase â[CP] Copy dSYMsâ
2) That command depends on command in Target 'GTMSessionFetcher' (project 'Pods'): script phase â[CP] Copy dSYMsâ
3) That command depends on command in Target 'GTMSessionFetcher' (project 'Pods'): script phase â[CP] Copy dSYMsâ
Multiple commands produce '/Users/felip/Library/Developer/Xcode/DerivedData/CashBack-cuszxqnldfepigfapfsmaoloyjan/Build/Products/Debug-iphoneos/nanopb/nanopb.framework.dSYM':
1) That command depends on command in Target 'nanopb' (project 'Pods'): script phase â[CP] Copy dSYMsâ
2) That command depends on command in Target 'nanopb' (project 'Pods'): script phase â[CP] Copy dSYMsâ
3) That command depends on command in Target 'nanopb' (project 'Pods'): script phase â[CP] Copy dSYMsâ
Multiple commands produce '/Users/felip/Library/Developer/Xcode/DerivedData/CashBack-cuszxqnldfepigfapfsmaoloyjan/Build/Products/Debug-iphoneos/BoringSSL-GRPC/openssl_grpc.framework.dSYM':
1) That command depends on command in Target 'BoringSSL-GRPC' (project 'Pods'): script phase â[CP] Copy dSYMsâ
2) That command depends on command in Target 'BoringSSL-GRPC' (project 'Pods'): script phase â[CP] Copy dSYMsâ
3) That command depends on command in Target 'BoringSSL-GRPC' (project 'Pods'): script phase â[CP] Copy dSYMsâ
Multiple commands produce '/Users/felip/Library/Developer/Xcode/DerivedData/CashBack-cuszxqnldfepigfapfsmaoloyjan/Build/Products/Debug-iphoneos/abseil/absl.framework.dSYM':
1) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
2) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
3) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
4) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
5) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
6) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
7) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
8) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
9) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
10) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
11) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
12) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
13) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
14) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
15) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
16) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
17) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
18) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
19) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
20) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
21) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
22) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
23) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
24) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
25) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
26) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
27) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
28) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
29) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
30) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
31) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
32) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
33) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
34) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
35) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
36) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
37) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
38) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
39) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
40) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
41) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
42) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
43) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
44) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
45) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
46) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
47) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
48) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
49) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
50) That command depends on command in Target 'abseil' (project 'Pods'): script phase â[CP] Copy dSYMsâ
Multiple commands produce '/Users/felip/Library/Developer/Xcode/DerivedData/CashBack-cuszxqnldfepigfapfsmaoloyjan/Build/Products/Debug-iphoneos/gRPC-Core/grpc.framework.dSYM':
1) That command depends on command in Target 'gRPC-Core' (project 'Pods'): script phase â[CP] Copy dSYMsâ
2) That command depends on command in Target 'gRPC-Core' (project 'Pods'): script phase â[CP] Copy dSYMsâ
3) That command depends on command in Target 'gRPC-Core' (project 'Pods'): script phase â[CP] Copy dSYMsâ
Multiple commands produce '/Users/felip/Library/Developer/Xcode/DerivedData/CashBack-cuszxqnldfepigfapfsmaoloyjan/Build/Products/Debug-iphoneos/gRPC-C++/grpcpp.framework.dSYM':
1) That command depends on command in Target 'gRPC-C++' (project 'Pods'): script phase â[CP] Copy dSYMsâ
2) That command depends on command in Target 'gRPC-C++' (project 'Pods'): script phase â[CP] Copy dSYMsâ
3) That command depends on command in Target 'gRPC-C++' (project 'Pods'): script phase â[CP] Copy dSYMsâ
Multiple commands produce '/Users/felip/Library/Developer/Xcode/DerivedData/CashBack-cuszxqnldfepigfapfsmaoloyjan/Build/Products/Debug-iphoneos/GoogleUtilities/GoogleUtilities.framework.dSYM':
1) That command depends on command in Target 'GoogleUtilities' (project 'Pods'): script phase â[CP] Copy dSYMsâ
2) That command depends on command in Target 'GoogleUtilities' (project 'Pods'): script phase â[CP] Copy dSYMsâ
3) That command depends on command in Target 'GoogleUtilities' (project 'Pods'): script phase â[CP] Copy dSYMsâ
4) That command depends on command in Target 'GoogleUtilities' (project 'Pods'): script phase â[CP] Copy dSYMsâ
5) That command depends on command in Target 'GoogleUtilities' (project 'Pods'): script phase â[CP] Copy dSYMsâ
6) That command depends on command in Target 'GoogleUtilities' (project 'Pods'): script phase â[CP] Copy dSYMsâ
7) That command depends on command in Target 'GoogleUtilities' (project 'Pods'): script phase â[CP] Copy dSYMsâ
8) That command depends on command in Target 'GoogleUtilities' (project 'Pods'): script phase â[CP] Copy dSYMsâ
Without cocoa-binary it doesn't get the errors in xcode
@FaultyJuggler Did you figure this out? I'm seeing the same.
same with binary ..
Yes, I am seeing the same as @FaultyJuggler in the latest version of cocoapods 1.10.0
EDIT: find a workaround here: https://github.com/CocoaPods/CocoaPods/issues/10373
Same happening with :binary => true
Tried workaround #10373 with no luck.
Found this post integrate script that did the trick, if someone is looking for:
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
Most helpful comment
We investigated the issue further, this is actually a much more complex change so it will have to be in 1.10.0 release.
The issue here is that CocoaPods treats dSYMs as if they were frameworks during the embedding stage versus all that is needed is to just copy the vendored dSYM into the Products dir.
I am re-implemeting this from scratch and will have a PR soon.