Try Sample Avcam from Apple Found Error

Try Sample AVCAM from apple found error

Update 15 Sept 2017:

Official response from Apple:

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

    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.

I can confirm using __availablePreviewPhotoPixelFormatTypes fixes the build errors.

E.g.

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

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


Update 14 Sept 2017:

Issue reoccurs in Xcode 9.0 GM (9A235).

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


Previous:

Update: Fixed in Xcode Beta 6.

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

Apple Mach-O Linker (ld) Error Group with Swift 3 & Xcode 9 GM

Update 15 Sept 2017:

Official response from Apple:

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

    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.

I can confirm using __availablePreviewPhotoPixelFormatTypes fixes the build errors.

E.g.

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

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

Weird compile error with AVCapture after updating to Xcode 9 / Swift 4

So I managed to solve this issue.

Somehow , with Xcode 9 you cannot have "free" code implemented that will not work on iOS Simulator.

The error - after solving it off - was pretty simple.

I cannot use the camera in the simulator, because it will not work.

I think Xcode could give more useful error information.

In order to solve this, in my CameraController class I had to edit my handleCapturePhoto() function.

I has to check that if the used architecture wasn't x86_64 (simulator) , then I could present the camera output.

This is the function solved state:

@objc func handleCapturePhoto() {
// processes the captured photo
let settings = AVCapturePhotoSettings()

// doesn't show in the simulator
#if (!arch(x86_64))
guard let preview = settings.previewPhotoFormat?.first else { return }
settings.previewPhotoFormat = [kCVPixelBufferPixelFormatTypeKey as String: preview]
output.capturePhoto(with: settings, delegate: self)
#endif
}

Hope this helps someone in the future.

How do I make use of SSLSetALPNProtocols?

As of the latest macOS and Xcode beta with Swift 4.1 I've got this up and running.



Related Topics



Leave a reply



Submit