Flutter工程在升级Xcode到13.3后打包应用报错如下:
Segmentation fault: 11 (in target 'DKImagePickerController' from project 'Pods')
但是运行不出错。
最终解决:
在ios目录下,运行pod update。pod install不行。
参考
https://github.com/flutter/flutter/issues/100142
直接原因:
pod库DKImagePickerController 没有适配Xcode 13.3
https://github.com/zhangao0086/DKImagePickerController/pull/696
相关的commit:
https://github.com/zhangao0086/DKImagePickerController/pull/696/commits/ded0926eb9fddf0bc03fa79d552b1cbd3537ce97
把 UI_USER_INTERFACE_IDIOM() 改成 UIDevice.current.userInterfaceIdiom
现在有问题的版本是:DKImagePickerController/Resource (4.3.2)
已解决问题的版本是:DKImagePickerController 4.3.3
需要把DKImagePickerController 升到 4.3.3
file_picker中引用DKImagePickerController时没有指明版本,应该就是最新版啊。
把Podfile.lock删除,重新 pod install 后,拉到的DKImagePickerController 还是4.3.2。
Flutter plugin file_picker 4.5.1 已经是最新版。
在file_picker/ios/Podfile中引用了 DKImagePickerController:
s.dependency 'DKImagePickerController/PhotoGallery'
没有指定特定版本,说明是DKImagePickerController的最新版。
在ios目录下,运行pod update就可以把DKImagePickerController升级到最新版了。pod install不行。