1. Sandbox: rsync(22154) deny(1) file-write-create Info.plist.x1ev76
解决方法:把 ENABLE_USER_SCRIPT_SANDBOXING 设置为NO
路径:Build Settings -> Build Options -> User Script Sandboxing 设置为NO
Apple added a new build setting to Xcode last year, ENABLE_USER_SCRIPT_SANDBOXING, which controls whether any “Run Script” build phases will be run in a sandbox or not. From the Xcode 14 Release Notes:
You can now enable sandboxing for shell script build phases using the ENABLE_USER_SCRIPT_SANDBOXING build setting. Sandboxing blocks access to files inside the source root of the project as well as the Derived Data directory unless you list those files as inputs or outputs. When enabled, the build fails with a sandbox violation if a script phase attempts to read from or write to an undeclared dependency, preventing incorrect builds.
2. Could not build module 'WebKit'
type argument 'nw_proxy_config_t' (aka 'struct nw_proxy_config *') is neither an Objective-C object nor a block type
1)解决方案一: 选中不能编译的库的xcodeproj,在Build Phrases -> Compile Sources,选中所有文件,Complier Flags 里删除 -DOS_OBJECT_USE_OBJC=0
可能是三方库的目标版本比较低,cocoapods兼容低版本自动加上了 -DOS_OBJECT_USE_OBJC=0,也可以修改库的podspec 的 s.platforms = { :ios => "11.0", :osx => "" } 重新 pod install
2)临时解决方案二:把 NSArray<nw_proxy_config_t> *proxyConfigurations 编译版本改为180000
编辑文件 /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebsiteDataStore.h
编辑系统文件需要root权限,使用sudo vim 或者 vscode等工具
3. 缺失 `libarclite_iphoneos.a`
有的三方库支持版本过低,在podfile文件中指定版本
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end
因为需要指定版本到有特殊要求,可以考虑从其他版本的Xcode拷贝
open /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/
放到对应的目录下即可:
4. Assertion failed
Assertion failed: (false && "compact unwind compressed function offset doesn't fit in 24 bits"), function operator(), file Layout.cpp, line 5758.
解决方法:Other Link Flags 添加-ld64 或者 -ld_classic
路径:Build Settings -> Linking - General -> Other Link Flags 添加-ld64 或者 -ld_classic
更新:似乎 Xcode 15.1 已经不用添加 -ld_classic 了。