I have a KMM project that uses CocoaPods and two targets, one for macOS, one for iOS.
For some reason, running a build for the macOS target causes all subsequent builds of the iOS target to fail with the following message:
conflicting deployment targets, both ‘MACOSX_DEPLOYMENT_TARGET’ and ‘IPHONEOS_DEPLOYMENT_TARGET’ are present in environment
Removing the macOS target, deleting the shared module build directory, deleting Xcode DerivedData, and deleting the Pods and reinstalling does not fix this.
2
Answers
We ran into this with our KM project as well when building for iOS. We were using XCode 14.3, our fix was to use XCode 14.2 for the time being.
Fixed by unsetting ENV vars in post archive script… Apple must change something. I do not see those env vars in source codes at all, probably ne version of xcode is setting them now and also the same xcode is faulting when they are all set.