Xcode15 在Flutter開發(fā)中遇到的一些坑
問題一:在Flutter 中遇到 NWPathMonitor() 初始化崩潰
在connectivity_plus文件中遇到的NWPathMonitor()崩潰問題的兩種解決方案
方案一:
把項目最低支持改為12.0及以上
NWPathMonitor.png
方案二:
podfile文件中添加
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 12.0
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
end
end
end
end
NWPathMonitor奔潰問題-解決方案參考來源-傳送門
問題二:關于flutter_inappwebview中webkit報錯的問題
error: type argument 'nw_proxy_config_t' (aka 'struct nw_proxy_config *') is neither an Objective-C object nor a block type
fatal error: could not build module 'WebKit'
方案一:
在相應sdk的podspec文件中添加s.platform = :ios, '13.0'
(拿inappwebview舉例)
具體操作:左側pods中找到Development Pods文件夾->flutter_inappwebview文件夾->pod文件夾->flutter_inappwebview.podspec文件->添加s.platform = :ios, '13.0'
最后重新pod install一下
webkit.png
方案二:
在相應SDK Build Phases -> Compile Sources 刪除 -DOS_OBJECT_USE_OBJC=0
image.png
問題三:Duplicate symbols報錯
在Xcode -> Target -> Build Setting -> Other Linker Flags 添加一行"-ld64"
ld64.png
開發(fā)者論壇Duplicate symbols錯誤反饋-傳送門
問題四: DT_TOOLCHAIN_DIR 錯誤
DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead
方案一:
1.更新pod為1.13.0及以上版本
2.重新pod install