cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacob Weber (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-11785) camera.getPicture fails with "Camera cancelled"
Date Tue, 30 Aug 2016 19:27:22 GMT

    [ https://issues.apache.org/jira/browse/CB-11785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15449908#comment-15449908
] 

Jacob Weber commented on CB-11785:
----------------------------------

This seems to be happening because I have:
{code}
<preference name="AndroidLaunchMode" value="singleInstance" />
{code}

If I use singleTask or singleTop it works correctly. So maybe this is an Android 4.x bug,
not a Cordova bug?

> 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: Android, 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
>
> 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


Mime
View raw message