iOSKit AVCaptureDeviceInput Crash


Is anyone aware of a crash when Starting the Barcode Read in iOSKit (running ios15 on iPhone Pro 12)?

At line:
dim input as AVCaptureDeviceInput = AVCaptureDeviceInput.DeviceInputWithDeviceError(captureDevice, err)

Does anyone know if there’s a work-around?



Not aware. Do you have a crash log you can share?

Just to make sure you’re running on a real device and not simulator, right?

Yes, real device, thanks. Crash Logs here. Thanks very much Jason

From the crash logs:

This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app’s Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.

Thanks very much Jeremie. Cool it’s not a bug. Now I just need to figure out how to do it! :smiley:

@Jeremie_L , that worked, thanks very much. @Jason_King, I think there still may be a problem. It goes though the motions and asks permission to use the camera, but then nothing. This is the info.plist I’m using:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
	<string>Uses your Library to scan barcodes</string>
	<string>Uses your Camera to scan barcodes</string>

I’ve tried it on a 12 Pro, SE and iPad Pro. Do you have any suggestions? Thanks again. Chris

Hi Jason. Are you still maintaining this code or should I try to look for some other alternative for scanning barcodes? Thanks again

Lets make this a feature request too please, the barcode scanning is a highly used feature in IOs and maybe xojo could use it for their xdc app.

Ironically we used Jason’s code in the first iOS XDC app when we were doing conference e-passes.

That’s what i mean, but it’s not embed into the actual language. i can’t undderstand why actually since iOSKit is MIT licensed… ?

For even experienced developers, declares in xojo are really hard to get right.

Every little thing we add to the framework makes every iOS app footprint larger and we’re very selective to add things that everyone will eventually need

I don’t get it, you have a compiler that would strip out anything unused right ? This should keep the app as small as possible, which is a must yes.
I dont see why it’s an issue to give users more and better features, even being selective. Maybe it’s better to revise your vision here, since ios still seems a little lacking in featues. Most importantly features that are really common, many apps.

@Chris_O_Brien did you checkout the API 2 branch of iOSKit ?

did you checkout the API 2 branch of iOSKit ?

Thanks DerkJ. I actually didn’t, but I will - I hadn’t spotted it.

Thanks again DerkJ. That was my problem…

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.