Anyone ever get camera on ios issues?

25 views
Skip to first unread message

mcell...@gmail.com

unread,
Nov 25, 2016, 3:53:51 AM11/25/16
to CodenameOne Discussions
Hi,

I have reports from some customers about the application occasionally crashing when taking a photo. I have got some logs that our application creates back from some of these customers which indicate that the crash, when it happens, occurs within a Capture.capturePhoto() call. ie I have this code in my app...

Application.log(Application.LOG_LEVEL_INFO, "About to capture Photo");

final String photoPath = Capture.capturePhoto();

Application.log(Application.LOG_LEVEL_INFO, "Have captured Photo");

and I can see from my logs that "About to capture Photo" is output but "Have capture Photo" hasn't been, indicating the crash happened within the CN1 method.

Has anyone come across this or is there any tips to reduce the chance of the crash happening? I'm not entrely sure but it may be more likely to crash on older hardware.

Granted the problem may very well be Apple not Codename one, but any info anyone has about this would be useful, just to get people of my back if nothing else.

Thanks,

Paul

Shai Almog

unread,
Nov 26, 2016, 12:55:37 AM11/26/16
to CodenameOne Discussions, mcell...@gmail.com
Hi,
we didn't get such reports recently so I'm not sure what can be causing it. If you can get in contact with a user to whom this is happening and see if this can be reproduced with a simple test case on his device and if so what if different about the device that would be helpful.

mcell...@gmail.com

unread,
Nov 28, 2016, 11:49:09 AM11/28/16
to CodenameOne Discussions, mcell...@gmail.com
Hi,

For what it's worth, he's running on original iPad mini, which I believe won't upgrade to ios 10 so it's one of the ios 9 versions. Also my code is built against version 3.5.

One thing I'm thinking though if something say on another thread causes my app to crash when the camera is open, would that only become apparent when I return from the camera back to the app (which has gone?) This could explain why it appears to crash in the Camera app. Just a thought though I woud have thought it would take everything down but not sure how it works on ios.

One thing I have noticed recently is that I wa getting a crash when a class cast exception should have been thrown and handled. Just thought it might be worth mentioning.

regards,

Paul

Shai Almog

unread,
Nov 29, 2016, 12:39:33 AM11/29/16
to CodenameOne Discussions, mcell...@gmail.com
Hi,
when you say 3.5 do you mean actual 3.5 or latest?
Those are very different things!
If you don't understand what I mean by this check out this: https://www.codenameone.com/how-do-i---get-repeatable-builds-build-against-a-consistent-version-of-codename-one-use-the-versioning-feature.html

You need to build against the latest if you experience an issue to ensure that the issue wasn't already resolved.

We don't support class cast exception in the iOS VM as it's assumed that this is an exception that wouldn't survive into production. Adding class cast exception tests will enlarge and slow down the final binary.

mcell...@gmail.com

unread,
Nov 29, 2016, 10:48:15 AM11/29/16
to CodenameOne Discussions, mcell...@gmail.com
Mixed up my last reply - I am a pro user not an enterprise user. Doh! Got them the wrong way round. Guess I could use crash_protet flag as well :)

Paul

Shai Almog

unread,
Nov 29, 2016, 11:51:53 PM11/29/16
to CodenameOne Discussions, mcell...@gmail.com
Yes but are you using latest or 3.5?
If you are using 3.5 that might be the problem...

Paul McEllin

unread,
Nov 30, 2016, 3:58:40 AM11/30/16
to Shai Almog, CodenameOne Discussions
Using 3.5 - and I guess it could be the problem. It's just it feels safer generally to build against a known stable release rather that a codebase that 'potentially' could change and introduce new errors at any time.... unless there is a later release that 3.5 I've missed somewhere?

Thanks,

Paul

Shai Almog

unread,
Dec 1, 2016, 12:45:19 AM12/1/16
to CodenameOne Discussions, shai....@gmail.com, mcell...@gmail.com
It's been a while but I think we fixed an issue with image capture on iOS 10 a while back. Please try building with latest and see if this solves the issue, if so then we already fixed the issue.
Reply all
Reply to author
Forward
0 new messages