Camera crashing bug

6 posts, 0 answers
  1. Nader
    Nader avatar
    43 posts
    Member since:
    Jun 2013

    Posted 09 Aug 2014 Link to this post

    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.
  2. Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 13 Aug 2014 Link to this post

    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.

     
  3. Nader
    Nader avatar
    43 posts
    Member since:
    Jun 2013

    Posted 16 Aug 2014 in reply to Tsvetina Link to this post

    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.
  4. Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 18 Aug 2014 Link to this post

    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.

     
  5. Nader
    Nader avatar
    43 posts
    Member since:
    Jun 2013

    Posted 19 Aug 2014 in reply to Tsvetina Link to this post

    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?

  6. Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 21 Aug 2014 Link to this post

    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.

     
Back to Top