Swift Apple Mach-O链接器错误

Aak*_*ave 3 mach-o ios swift3 swift4 xcode9

我将我的项目从swift 3转换为swift 4并使用最新版本的xcode 9.在构建时,我收到以下错误:

Undefined symbols for architecture arm64: "__T0So22AVCapturePhotoSettingsC12AVFoundation01_abC16SwiftNativeTypesACWP", referenced from: __T06SpotMi8CameraVCC12capturePhotoyypF in CameraVC.o "__T012AVFoundation39_AVCapturePhotoSettingsSwiftNativeTypesPAAE016availablePreviewc11PixelFormatG0SaySo8NSNumberCGfg", referenced from: __T06SpotMi8CameraVCC12capturePhotoyypF in CameraVC.o ld: symbol(s) not found for architecture arm64 我没有线索.任何帮助都感激不尽.

干杯!

dat*_*eah 13

XCode9中存在一个错误.Apple无意中将AVFoundation中的某些功能设为私有.

解决方法:

更改availablePreviewPhotoPixelFormatTypes__availablePreviewPhotoPixelFormatTypes您的源.

同样如下:

supportedColorSpaces -> __supportedColorSpaces

supportedFlashModes -> __supportedFlashModes

availableRawPhotoPixelFormatTypes -> __availableRawPhotoPixelFormatTypes

availablePhotoPixelFormatTypes -> __availablePhotoPixelFormatTypes

然后它可能会编译!祝好运!