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
The output file entries of the Embed Pods Frameworks phase should be deduplicated. #7259
Comments
Verified, removing the duplicate fixes the issue. Only an issue on the new Xcode 9 build system Thank you for the detailed report and example project! |
Isnt this fixed by 1.4.0? @amorde care to open a PR for this? |
I'll check against master, forgot to do that. But yes I think I can tackle this |
<3 |
master actually introduces another duplicate, it changed the resources script to this: --- a/TestCocoaPods.xcodeproj/project.pbxproj
+++ b/TestCocoaPods.xcodeproj/project.pbxproj
@@ -217,7 +217,8 @@
);
name = "[CP] Copy Pods Resources";
outputPaths = (
- "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}",
+ "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Onfido-Onfido.bundle",
+ "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Onfido-Onfido.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; I will try to get a fix in later today - @dnkoutso can you add the new build system tag? |
ah master now correctly lists all bundles individually instead of my initial lazy approach to use the folder. We need to inspect the |
@amorde seems like configuration does not play role into the |
another workaround is the |
@amorde I put a bit more thought on this. This diff should do it. diff --git a/lib/cocoapods/installer/user_project_integrator/target_integrator.rb b/lib/cocoapods/installer/user_project_integrator/target_integrator.rb
index cf07812afd3..074583ba875 100644
--- a/lib/cocoapods/installer/user_project_integrator/target_integrator.rb
+++ b/lib/cocoapods/installer/user_project_integrator/target_integrator.rb
@@ -287,7 +287,7 @@ module Pod
base_path = '${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}'
output_extension = TargetIntegrator.output_extension_for_resource(File.extname(input_path))
File.join(base_path, File.basename(input_path, File.extname(input_path)) + output_extension)
- end
+ end.uniq
end
TargetIntegrator.add_copy_resources_script_phase_to_target(native_target, script_path, input_paths, output_paths)
end
@@ -320,7 +320,7 @@ module Pod
output_paths = []
unless framework_paths_by_config.all?(&:empty?)
input_paths = [target.embed_frameworks_script_relative_path, *framework_paths_by_config.map { |fw| [fw[:input_path], fw[:dsym_input_path]] }.flatten.compact]
- output_paths = framework_paths_by_config.map { |fw| [fw[:output_path], fw[:dsym_output_path]] }.flatten.compact
+ output_paths = framework_paths_by_config.map { |fw| [fw[:output_path], fw[:dsym_output_path]] }.flatten.compact.uniq
end
TargetIntegrator.add_embed_frameworks_script_phase_to_target(native_target, script_path, input_paths, output_paths)
end However, it is important to note that two pods that have the same bundle or framework on the SAME configuration should probably be a warning or an error to the user. You can add such a check within The above diff fixes this issue which is valid since the same bundle name is being used for different configurations. With the diff I above I now see: diff --git a/TestCocoaPods.xcodeproj/project.pbxproj b/TestCocoaPods.xcodeproj/project.pbxproj
index 4a0059b..4bdd344 100644
--- a/TestCocoaPods.xcodeproj/project.pbxproj
+++ b/TestCocoaPods.xcodeproj/project.pbxproj
@@ -217,7 +217,7 @@
);
name = "[CP] Copy Pods Resources";
outputPaths = (
- "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}",
+ "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Onfido-Onfido.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; |
That's actually exactly what I did :) just finishing up some tests for it |
Report
What did you do?
Given the following dependency specification:
The CocoaPods integration creates a Embed Pods Framework phase, which has the two entries of the identical file path as its output file — in this case
${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Onfido.framework
. While this does not cause an issue with the old build system, the Xcode 9 new build system refuses to proceed unless either of the identical entries is manually removed.What did you expect to happen?
It should work with the Xcode 9 new build system.
What happened instead?
The Xcode 9 new build system refuses to build the project with the said generated build phase, unless manual change is made (which gonna be overwritten by CocoaPods the next time it is invoked).
CocoaPods Environment
Stack
Installation Source
Plugins
Example
https://github.com/andersio/TestCocoaPods
The text was updated successfully, but these errors were encountered: