You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Shazron Abdullah (JIRA)" <ji...@apache.org> on 2015/03/03 21:58:06 UTC

[jira] [Commented] (CB-8599) camera crashes when opened

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

Shazron Abdullah commented on CB-8599:
--------------------------------------

Fix is that whole call should be dispatched in the main thread: https://github.com/apache/cordova-plugin-camera/blob/80b00483846ce30c9b895b106a69767a102fc0f1/src/ios/CDVCamera.m#L170



> camera crashes when opened
> --------------------------
>
>                 Key: CB-8599
>                 URL: https://issues.apache.org/jira/browse/CB-8599
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS, Plugin Camera
>    Affects Versions: 3.5.0, 3.8.0
>         Environment: cordova-lib@4.3.1-dev
> ios@3.8.0
> camera@0.3.5
> iPhone 5s @ 8.1.3 (12B466)
>            Reporter: Murat Sutunc
>            Assignee: Shazron Abdullah
>
> -Create a new project.
> -Add ios platform and camera
> -Replace www/index.html with: https://gist.github.com/anonymous/09d4cd8134afe8a53d50
> -Deploy the app to iphone5s
> -It will crash with the following messages on console: 
> https://gist.github.com/muratsu/daf959cad4905cbb5b3e
> When debugged in xcode I've found the following. In CDVViewController.m (shouldAutorotateToInterfaceOrientation) calling the eval is throwing:
> {code}
>     NSString* jsCall = [NSString stringWithFormat:
>         @"window.shouldRotateToOrientation && window.shouldRotateToOrientation(%ld);"
>         , (long)[self mapIosOrientationToJsOrientation:interfaceOrientation]];
>     NSString* res = [webView stringByEvaluatingJavaScriptFromString:jsCall];
> {code}
> On a separate thread we have CDVCamera.m (takePicture): 
> throwing a EXC_BAD_ACCESS at 
> {code}
> weakSelf.viewController presentViewController:cameraPicker animated:YES completion:^
> {code}
> The bad access I believe is due to the fact that this thread runs in the background but tries to do UI manipulation. 
> I've tried the same cordova app with camera r0.3.4 and it worked fine on iphone 5s. Looks like we've broken this with r0.3.5 refactoring.



--
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