xcode 环境中存在冲突的部署目标“MACOSX_DEPLOYMENT_TARGET”和“IPHONEOS_DEPLOYMENT_TARGET”

3qpi33ja  于 2023-05-19  发布在  Mac
关注(0)|答案(2)|浏览(322)

我有一个使用CocoaPods和两个目标的KMM项目,一个用于macOS,一个用于iOS。出于某种原因,运行macOS目标的构建会导致iOS目标的所有后续构建失败,并显示以下消息:
冲突的部署目标,环境中同时存在“MACOSX_DEPLOYMENT_TARGET”和“IPHONEOS_DEPLOYMENT_TARGET”
删除macOS目标,删除共享模块构建目录,删除Xcode DerivedData,删除Pod并重新安装并不能解决这个问题。

6psbrbz9

6psbrbz91#

在为iOS构建时,我们在KM项目中也遇到了这个问题。我们使用的是XCode 14.3,我们的修复是暂时使用XCode 14.2。

pu82cl6c

pu82cl6c2#

通过在后期存档脚本中取消设置ENV变量修复...苹果必须做出改变。我在源代码中根本没有看到这些env变量,可能是新版本的xcode正在设置它们,当它们都设置好时,同一个xcode也会出错。

# 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

相关问题