赞
踩
升级到Xcode15遇到的问题
因为Xcode15支持的最低版本号为iOS12,所以引用的三方库也要都升级到最低支持版本号为iOS12,目前可以通过以下方式解决:
在podfile文件里最下面增加以下代码:
post_install do |installer|
xcode_base_version = `xcodebuild -version | grep 'Xcode' | awk '{print $2}' | cut -d . -f 1`
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
# For xcode 15+ only
if config.base_configuration_reference && Integer(xcode_base_version) >= 15
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
xcconfig_path = config.base_configuration_reference.real_path
xcconfig = File.read(xcconfig_path)
xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
end
end
end
end
然后在终端运行:pod install
如果报错的话就运行pod install --verbose --repo-update
一般出现这个问题,有可能是工程索引出现问题,需要清除历史缓存和索引,可以通过以下方式解决
在终端输入以下代码:
rm -frd ~/Library/Caches/com.apple.dt.Xcode/*
rm -frd ~/Library/Developer/Xcode/DerivedData
重启Xcode,重新编译项目
现在在App Store里搜素Xcode应用,直接要求MAC系统版本为14.0以上,但是针对遇2018年之前的MAC机型目前系统支持到最新版本号为13.6.6,无法升级到14.0,为了使用Xcode15,我们可以在 https://developer.apple.com/download/applications/,这个下面下载Xcode15.2以下版本,下载完成后,解压,拖到应用程序里面。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。