iOS 17 适配 Xcode 15 问题

在适配 iOS 17 + xcode 15时遇到的问题,记录一下。

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

  1. 临时方案
    NSArray *proxyConfigurations 编译版本改为180000
    编辑文件 /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebsiteDataStore.h
    将里面的 170000 修改成 180000。

2、 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

你可能感兴趣的:(iOS,之旅,ios,xcode,cocoa)