升级到xcode15时,项目依赖的pod中包含如下类型的代码时
@try {
...
} @catch (NSError *e) {
...
}
编译没问题,但运行项目会crash:
dyld[2544]: Symbol not found: _OBJC_CLASS_$_NSError
Referenced from: /private/var/containers/Bundle/Application/18DFF079-5E7A-49C0-B8BF-9B43A6BD88CB/Runner.app/Runner
Expected in: /private/var/containers/Bundle/Application/18DFF079-5E7A-49C0-B8BF-9B43A6BD88CB/Runner.app/Frameworks/camera_avfoundation.framework/camera_avfoundation
解决办法,就是将NSError *
改为 NSException *
@try {
...
} @catch (NSException *e) {
...
}
在运行项目就没问题了。
参考资料:
https://github.com/RonRadtke/react-native-blob-util/pull/288
https://developer.apple.com/forums/thread/735610