This is a migrated thread and some comments may be shown as answers.

Camera crashing bug

5 Answers 54 Views
Report a bug
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nader
Top achievements
Rank 1
Nader asked on 09 Aug 2014, 09:36 AM
Lately I have been experiencing a bug with the photo capture API, where the app would crash when taking a photo using the camera, and it would sometimes refresh the app on android devices and force close the app on iOS devices. I tried to debug the app using the "iPhone Configuration Utility" but have not been able get any error logs regarding the crash.

5 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 13 Aug 2014, 03:15 PM
Hello Nader,

Have you tried the suggestion provided in this forum post? The description that you give exactly fits the scenario this post discusses.

Regards,
Tsvetina
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
Nader
Top achievements
Rank 1
answered on 16 Aug 2014, 06:18 AM
Hi Tsvetina,

I am currently using the FILE_URI as the destination type, but still it does not seem to work. As a matter of fact, I need to use the FILE_URI as I need to upload the captured photo afterwards.

I have tried my code on the following devices with the following results:
1- iPhone 4S - iOS7, the app crashes after taking a photo
2- Samsung Galaxy S3 - Android 4.2, the app crashes after taking a photo
3- iPhone 5 - iOS7, the app works as expected and I am able to take pictures without any issues

I also tried building my app in XCode and Eclipse, but still got the same results.
0
Tsvetina
Telerik team
answered on 18 Aug 2014, 03:52 PM
Hi Nader,

Another thing that you can try is to lower the image quality of the picture taken by setting the ​quality​ option to 50, as shown in the examples in the getPicture method documentation:

navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
    destinationType: Camera.DestinationType.FILE_URI });

The behavior of the app on different devices still sounds as if an out of memory exception occurs and the OS kills or restarts the app. So you should be looking for any settings or actions that may lead to the use of too much memory by the app. Processing large images (with high quality) is one such option.

Regards,
Tsvetina
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
Nader
Top achievements
Rank 1
answered on 19 Aug 2014, 06:24 AM
Hi Tsvetina,

I have already tried changing the quality of the captured image with no luck. I have even tried setting it to 20, but the app would continue to crash upon capturing an image.
The strange thing is that it worked when I rebuilt my project using AppBuilder, but the same issue is still persistent when the same project is built using XCode and Eclipse.

Any thoughts on why such a thing would happen?

0
Tsvetina
Telerik team
answered on 21 Aug 2014, 11:38 AM
Hi Nader,

If I understand correctly, the app now works if you build it in AppBuilder but does not work when you build it through XCode/Eclipse? If you are trying to build the project outside of AppBuilder you need to make sure that you add the Camera plugin manually to it, to create the needed configuration files with the required permissions (specifically the one to use the camera), etc. This is done automatically by AppBuilder and if the error occurs only outside of AppBuilder, it is most probably due to a missing configuration setting.

Regards,
Tsvetina
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
Report a bug
Asked by
Nader
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Nader
Top achievements
Rank 1
Share this question
or