apache / cordova-plugin-camera

Apache Cordova Plugin camera
https://cordova.apache.org/
Apache License 2.0
960 stars 1.52k forks source link

On iOS 16+ when you open camera it crashes and closes the app #864

Closed kristapspicelevics closed 6 months ago

kristapspicelevics commented 6 months ago

Bug Report

Problem

On iOS 16+ when you open camera it crashes and closes the camera

What is expected to happen?

The camera should open

What does actually happen?

App crashes when you open camera

It also gives warning as follows:

Attempted to change to mode Portrait with an unsupported device (BackWide). Auto device for both positions unsupported, returning Auto device for same position anyway (BackAuto).

Information

Before mentioned warning does not appear with iOS 15.7.2 and below

const options: CameraOptions = { quality: 90, destinationType: Camera.DestinationType.FILE_URI, encodingType: Camera.EncodingType.JPEG, mediaType: Camera.MediaType.PICTURE, sourceType: Camera.PictureSourceType.CAMERA, correctOrientation: true, targetWidth: 700 }

Command or Code

await Camera.getPicture(options).then((result) => { ... });

Environment, Platform, Device

iPhone 17.0.3 iOS version

Version information

cordova-plugin-version: 6.0.0 Ionic 5.5.2 xCode 15.0

Checklist

erisu commented 6 months ago

Looks like you're using an old version of the plugin. Also I think this issue was resolved in version 7.x.

I would recommend to try upgrading and testing. You most likely will also need to upgrade the platforms too.

kristapspicelevics commented 6 months ago

I looked into plugins RELEASENOTES.md i found no mention of iOS 16 or above. It does mention iOS 15 though.

kristapspicelevics commented 6 months ago

I updated the plugin, seems to be working, closing the issue.