I am trying to add a custom framework to my iOS app. The framework includes code for both x86_64 architecture and arm64 architecture. When I try to build my project on my MacOS for simulator I receive multiple errors of the same form:
As I see the problem is that its trying to copy files from both folders, the ios_x86_64_simulator and ios_arm64 and thus produces same headers which causes it to fail.
I have tried doing clean install of my whole Pods, changing the order of build phases, excluding architectures "arm64" for debug and release builds both for my project as well as all targets however I keep getting the same error.
In the end I fixed the issue with combining frameworks for both architectures using lipo.
For example:
lipo -create ios-arm64/A.framework/A ios-x86_64-simulator/B.framework/B -output combined.framework