iOSPicturePicker Runtime Error

  1. 6 weeks ago

    Hans-Jürgen M

    Aug 13 Pre-Release Testers, Xojo Pro Europe (Germany)

    In my app i have a view to shot Fotos.
    The views controls are the iOSPicturePicker, a BottomBar (a canvas ) and a canvas to show the taken picture.
    In the Activate event of the view i try to show the iOSPicturePicker with it's Source property set to camera.

    On a real device (iPhoneX) the app ends with no comment.

    In the Simulators there are no problems, but in DebugMode i cannot set the source to camera (it's CameraRoll).

    To make sure that there is no side effect from my custom controls i removed every control except the iOSPicturePicker, but without success!

    Has anyone an idea what's happened here or should i send a Feedback with an error description?
    Thanks in advance

    It sounds like this might need the NSCameraUsageDescription key in the plist in order to allow camera access. The phone log should have a description of why it crashed.

    https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html

    If this is the cause, the plist would look like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key> NSCameraUsageDescription </key>
    	<string>Allow user to use the camera.</string>
    </dict>
    </plist>

    http://developer.xojo.com/using-a-plist

    I'll test this soon and update the docs accordingly.

  2. Paul L

    Aug 13 Xojo Inc Answer http://developer.xojo.com

    It sounds like this might need the NSCameraUsageDescription key in the plist in order to allow camera access. The phone log should have a description of why it crashed.

    https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html

    If this is the cause, the plist would look like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key> NSCameraUsageDescription </key>
    	<string>Allow user to use the camera.</string>
    </dict>
    </plist>

    http://developer.xojo.com/using-a-plist

    I'll test this soon and update the docs accordingly.

  3. Hans-Jürgen M

    Aug 14 Pre-Release Testers, Xojo Pro Europe (Germany)

    Thanks Paul, this was the solution.
    Would be nice if this situation would return an error instead of simply crashing ;-))

  4. Jeremie L

    Aug 14 Pre-Release Testers, XDC Speakers Europe (France) - getpackr.io

    It would be even nicer if Xojo displayed a warning when building the app

  5. Greg O

    Aug 14 Xojo Inc Somewhere near Raleigh, NC

    @Jeremie L It would be even nicer if Xojo displayed a warning when building the app

    As soon as Apple added this restriction, we added a default plist entry to the next version of Xojo. There’s nothing much else we can do as there’s no way to know ahead of time what Apple will choose for the key name/value.

  6. Jason K

    Aug 14 Pre-Release Testers

    When something new like this appears you could have it on a Xojo server and the IDE would phone home and download the updates required for the plist so that it would be handled automatically and not need an update to the Xojo version.

  7. Tim P

    Aug 14 Pre-Release Testers feedback://46303

    To be fair, that is over-simplifying very unpredictable changes that can range from plist entries to complicated re-implementations.

  8. Gavin S

    Aug 14 Pre-Release Testers, Xojo Pro UK

    @Jason K When something new like this appears you could have it on a Xojo server and the IDE would phone home and download the updates required for the plist so that it would be handled automatically and not need an update to the Xojo version.

    Wasn't exactly the above done a couple of years ago for something? I forget what now, something in iOS. The IDE phoned home and downloaded an incremental update for... something.

or Sign Up to reply!