尝试从苹果找到AVCAM示例错误 [英] Try Sample AVCAM from apple found error

查看:105
本文介绍了尝试从苹果找到AVCAM示例错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用Xcode版本9.0 beta 5(9M202q)采样AVCAM swift时.我发现了错误.

When I tried sample AVCAM swift with Xcode Version 9.0 beta 5 (9M202q). I found errors.

x86_64体系结构的未定义符号:
"__T0So22AVCapturePhotoSettingsC12AVFoundation01_abC16SwiftNativeTypesACWP", 引用自: __T05AVCam20CameraViewControllerC12capturePhoto33_F53A4CF98D799BDDCA6C04BA14C549A1LLySo8UIButtonCFyycfU_ 在CameraViewController.o
中 "__T012AVFoundation39_AVCapturePhotoSettingsSwiftNativeTypesPAAE016availablePreviewc11PixelFormatG0Says6UInt32VGfg", 引用自: __T05AVCam20CameraViewControllerC12capturePhoto33_F53A4CF98D799BDDCA6C04BA14C549A1LLySo8UIButtonCFyycfU_ 在CameraViewController.o ld中:找不到架构符号 x86_64 clang:错误:链接器命令失败,退出代码为1(使用-v可以 参见调用)

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

出什么问题了?以及如何解决?

What is the problem? and How can fix that?

推荐答案

更新2017年9月15日:

Apple的官方回应:

Update 15 Sept 2017:

Official response from Apple:

我们的道歉.对于使用Swift 3.2或Swift 4.0的应用, AVFoundation捕获API(外部协议的公共扩展) 在Xcode 9中被无意中标记为私有. AVFoundation API暂时不可用:

Our apologies. For apps using Swift 3.2 or Swift 4.0, several AVFoundation capture APIs (public extensions on external protocol) were inadvertently marked private in Xcode 9. The following AVFoundation API are temporarily unavailable:

  • AVCaptureDevice.Format.supportedColorSpaces

AVCaptureDevice.supportedFlashModes

AVCapturePhotoOutput.availablePhotoPixelFormatTypes

AVCapturePhotoOutput.availableRawPhotoPixelFormatTypes

AVCapturePhotoSettings.availablePreviewPhotoPixelFormatTypes

作为解决方法,您可以使用这些API的SwiftPrivate版本 通过在每个API前面加上双下划线(__).例如, 将AVCaptureDevice.Format.supportedColorSpaces更改为 AVCaptureDevice.Format.__supportedColorSpaces.

As a workaround you can use the SwiftPrivate versions of these API by prepending each API with double underscore (__). For example, change AVCaptureDevice.Format.supportedColorSpaces to AVCaptureDevice.Format.__supportedColorSpaces.

我可以确认使用__availablePreviewPhotoPixelFormatTypes修复了构建错误.

I can confirm using __availablePreviewPhotoPixelFormatTypes fixes the build errors.

例如

let settings = AVCapturePhotoSettings()
let previewPixelType = settings.__availablePreviewPhotoPixelFormatTypes.first!

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

该问题再次出现在 Xcode 9.0 GM(9A235)中.

Issue reoccurs in Xcode 9.0 GM (9A235).

提交新的错误报告以供参考:rdar://34420979

Filed new bug report for reference: rdar://34420979

上一个:

更新:已在Xcode Beta 6中修复.

Update: Fixed in Xcode Beta 6.

提交了针对Xcode 9.0 beta 5(9M202q)的错误报告rdar://33935456.

Filed a bug report rdar://33935456 for Xcode Version 9.0 beta 5 (9M202q).

这篇关于尝试从苹果找到AVCAM示例错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆