Skip to content
This repository has been archived by the owner on Jun 13, 2019. It is now read-only.

Crash on session.addOutput(self.captureVideoOutput) #57

Closed
natewitty opened this issue Oct 8, 2016 · 3 comments
Closed

Crash on session.addOutput(self.captureVideoOutput) #57

natewitty opened this issue Oct 8, 2016 · 3 comments

Comments

@natewitty
Copy link

natewitty commented Oct 8, 2016

Ever since updating to XCode8 and Swift3, I've been getting a crash in CameraEngineOutput.swift in the func configureCaptureOutput

session.addOutput(self.captureVideoOutput)

I've updated my podfile to point to the 1.0 branch and the app builds fine, but it crashes on the splash screen giving the error:
Thread 4: EXC_BAD_ACCESS (code=1, address=0x50)
(Note: Thread 4 is the capturesession thread)

Has anyone else been getting this? I'm at a loss as to what to do. Currently it's taking down my whole app... not just the camera tab. Everything was working great before the switch to Swift3.

Thanks.

@bryanbartow
Copy link

+1. I'm getting this, too.

@natewitty
Copy link
Author

natewitty commented Oct 19, 2016

I think I've figured out what was causing this issue for me. Hopefully this will help you also.

I ended up needing to add Microphone permissions to my info.plist

<key>NSMicrophoneUsageDescription</key>
<string>Place whatever description you want here</string>

While you're at it, it might be helpful to add these permissions as well.

<key>NSCameraUsageDescription</key>
<string>Your description</string>

<key>NSPhotoLibraryUsageDescription</key>
<string>Your description</string>

My app doesn't use video capabilities, so I never thought to add the microphone permissions. However, when CameraEngine is initialized and it starts adding these Outputs, Xcode will crash if you aren't asking permission to use certain parts of the hardware.

Xcode really does a bad job of handling these errors. So, it doesn't seem like it has anything to do with CameraEngine at all.

remirobert: It might be helpful to future users if you place a warning in the README file about these required permissions in iOS 10. Just a thought. Thanks for all your hard work on this.

@bryanbartow
Copy link

@natewitty That was it. I'm assuming this is documented somewhere by Apple, so it was my fault for not RTFM, but Xcode could definitely do a better job of handling this. Time to file a radar...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants