更新到Xcode 9有错误

时间:2017-09-26 17:13:43

标签: ios swift xcode9

我最近更新到Xcode 9,当我构建我的应用程序时,我得到Apple Mach-0链接器(iD)错误。在更新项目之前工作得很好。错误如下所示:

Undefined symbols for architecture arm64:
"__T0So22AVCapturePhotoSettingsC12AVFoundation01_abC16SwiftNativeTypesACWP", referenced from:
 __T09Lifelapse20CameraViewControllerC14capturePictureyyF in CameraViewController.o
"__T012AVFoundation39_AVCapturePhotoSettingsSwiftNativeTypesPAAE016availablePreviewc11PixelFormatG0SaySo8NSNumberCGfg", referenced from:
 __T09Lifelapse20CameraViewControllerC14capturePictureyyF in CameraViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我不确定如何修复此错误,谢谢。

1 个答案:

答案 0 :(得分:0)

有一个错误的Xcode 9错误苹果。他们做了一些扩展是私有的。您必须将__放在这些方法调用上。

示例:

尝试更改let previewPixelType = settings.availablePreviewPhotoPixelFormatTypes.first!

let previewPixelType = settings.__availablePreviewPhotoPixelFormatTypes.first!

*** Apple意外地将一些AVFoundation API外部协议私有化,因此在访问它们的方法之前有2个不受欢迎的_。

来源:https://forums.developer.apple.com/thread/86810#259270