skip to Main Content

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


  1. 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.

    Login or Signup to reply.
  2. 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.

    # Fix errors:
    # conflicting deployment targets, both 'MACOSX_DEPLOYMENT_TARGET' and 'IPHONEOS_DEPLOYMENT_TARGET' are present in environment
    # conflicting deployment targets, both 'IPHONEOS_DEPLOYMENT_TARGET' and 'TVOS_DEPLOYMENT_TARGET' are present in environment
    # conflicting deployment targets, both 'IPHONEOS_DEPLOYMENT_TARGET' and 'WATCHOS_DEPLOYMENT_TARGET' are present in environment
    # conflicting deployment targets, both 'IPHONEOS_DEPLOYMENT_TARGET' and 'DRIVERKIT_DEPLOYMENT_TARGET' are present in environment
    unset MACOSX_DEPLOYMENT_TARGET
    unset TVOS_DEPLOYMENT_TARGET
    unset WATCHOS_DEPLOYMENT_TARGET
    unset DRIVERKIT_DEPLOYMENT_TARGET
    

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search