You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Vladimir Kotikov (JIRA)" <ji...@apache.org> on 2016/08/31 11:31:21 UTC

[jira] [Resolved] (CB-11785) camera.getPicture fails with "Camera cancelled"

     [ https://issues.apache.org/jira/browse/CB-11785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vladimir Kotikov resolved CB-11785.
-----------------------------------
    Resolution: Won't Fix

This is known problem - see SO threads below:

http://stackoverflow.com/questions/36986573/android-get-result-from-camera-intent-in-onnewintent
http://stackoverflow.com/questions/21446325/android-camera-intent-returns-immediately
http://stackoverflow.com/questions/7910840/android-startactivityforresult-immediately-triggering-onactivityresult

> camera.getPicture fails with "Camera cancelled"
> -----------------------------------------------
>
>                 Key: CB-11785
>                 URL: https://issues.apache.org/jira/browse/CB-11785
>             Project: Apache Cordova
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: Plugin Camera
>    Affects Versions: 2.2.0, 2.1.1
>         Environment: Samsung Tab 3 with Android 4.4.2
> Samsung Galaxy Nexus with Android 4.2.2
>            Reporter: Jacob Weber
>              Labels: triaged
>
> When I call navigator.camera.getPicture on certain Android devices, it immediately calls the error handler with the message "Camera cancelled".
> Internally it calls onActivityResult with requestCode=34 and resultCode=0.
> This is similar to CB-10246, but I verified that I'm not calling getPicture twice, like in that issue.
> It's happening on the devices listed under "Environment", but not on a Nexus 5 running Android 6.0.1 or any iOS device.
> Here are the logs, from immediately after calling getPicture. Nothing is logged after I close the camera window.
> {code}
> (navigator.camera.getPicture called)
> 08-30 18:14:13.718 1527-1527/com.mycompany.myapp D/CordovaInterfaceImpl: Sending activity result to plugin
> 08-30 18:14:13.851 1527-1582/com.mycompany.myapp W/CordovaPlugin: Attempted to send a second callback for ID: Camera1644792948
>                                                                          Result was: "No result"
> 08-30 18:14:13.851 1527-1582/com.mycompany.myapp W/PluginManager: THREAD WARNING: exec() call to Camera.takePicture blocked the main thread for 175ms. Plugin should use CordovaInterface.getThreadPool().
> (error callback called with "Camera cancelled")
> 08-30 18:14:14.304 1527-1527/com.mycompany.myapp W/IInputConnectionWrapper: showStatusIcon on inactive InputConnection
> {code}
> I'm passing the following options to getPicture:
> {code}
> sourceType: Camera.PictureSourceType.CAMERA,
> destinationType: Camera.DestinationType.FILE_URI,
> correctOrientation: true,
> allowEdit: false,
> targetWidth: 1600,
> targetHeight: 1600,
> quality: 30,
> encodingType: Camera.EncodingType.JPEG
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org