Please record the problems encountered when adapting to 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
solution:
- Select the xcodeproj of the library that cannot be compiled,
Build Phrases -> Compile Sources
select all files,Complier Flags
and delete it.-DOS_OBJECT_USE_OBJC=0
It may be that the target version of the third-party library is relatively low. Cocoapods is compatible with lower versions and automatically adds - DOS_OBJECT_USE_OBJC=0
. You can also modify the podspec of the library s.platforms = { :ios => "11.0", :osx => "" }
again pod install
.
- Temporary solution:
ChangeNSArray<nw_proxy_config_t> *proxyConfigurations
the compiled version to 180000.
Edit the file/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebsiteDataStore.h
and change the 170000 in it to 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.
Solution: Other Link Flags
Add -ld64
or -ld_classic
Path: Build Settings
-> Linking
- General
-> Other Link Flags
Add -ld64
or-ld_classic
post_install do |installer|
# 调试flutter时打开
# flutter_post_install(installer) if defined?(flutter_post_install)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
# 同步 pod 库的最低支持版本为 10.0
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
# config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
# pod 也要添加“模拟器排除 arm64 支持”
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
# 修复 Xcode 15 上,ios 14及以下版本运行时崩溃的问题
xcode_version = `xcrun xcodebuild -version | grep Xcode | cut -d' ' -f2`.to_f
if xcode_version ≥ 15
config.build_settings["OTHER_LDFLAGS"] = "$(inherited) -Wl, -ld_classic"
end
# 修复 Xcode 14 中,Pod 工程中的 Bundle target 签名报错的问题
config.build settings["CODE SIGN IDENTITY"] = = ""
# if target.name.eql?('SnapKit')
# libraries = config.build_settings['OTHER_LDFLAGS']
# config.build_settings['OTHER_LDFLAGS'] = "#{libraries} -lswiftCoreGraphics"
# libraryPath = config.build_settings['LIBRARY_SEARCH_PATHS']
# config.build_settings['LIBRARY_SEARCH_PATHS'] = "#{libraryPath} $(SDKROOT)/usr/lib/swift"
# end
end
end
end