Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Camera crashing app randomly on iPhone device...HELP!!!

my specs:
Mac OS X 10.6.4, iOS 4, Mobile SDK 1.4
iPhone 3gs, with iOS 3.1.3

my app will randomly crash when opening up the camera on the device. sometimes it crashes when opening the camera, sometimes it crashes after taking the photo, sometimes it crashes after hitting 'retake' photo, sometimes it crashes when hitting 'use' after the photo has been taken.

it really is all over the place.

any and all help you guys can give me would be greatly appreciated. thank you!!

rocksteady,
danno~

— asked August 23rd 2010 by danno watts
  • camera
  • crashing
  • iphone
1 Comment
  • +1. Please fix this!

    — commented November 9th 2010 by Nils D

16 Answers

  • bump!

    — answered August 23rd 2010 by danno watts
    permalink
    0 Comments
  • bump!!

    — answered August 25th 2010 by danno watts
    permalink
    0 Comments
  • I've had similar issues also.

    — answered August 25th 2010 by John Welch
    permalink
    0 Comments
  • bump!!!

    — answered August 28th 2010 by danno watts
    permalink
    0 Comments
  • bump!!!

    — answered August 30th 2010 by danno watts
    permalink
    0 Comments
  • bump!!!

    — answered August 30th 2010 by danno watts
    permalink
    0 Comments
  • have you tried one of the latest builds? 1.4.1
    http://builds.appcelerator.com.s3.amazonaws.com/index.html

    i had issues with it not displaying picture properly with 1.4 on 3.1.3(worked fine on ios4),
    that was fixed with later build, it is very slow but that's another problem for me to look at,
    the other thing is to see what it crashes on using organizer in xcode i think, should get you the crash logs.

    one more thing, is there plenty of memory space on the iphone?

    just ideas hope they are of some use

    Rob

    — answered August 31st 2010 by Robert Greenock
    permalink
    1 Comment
    • well i just downloaded the latest build of 1.4.1 and upon opening it in the simulator it ruined my imageViews and how they were displayed as well as spit out a few warning about the TiUIScrollView…. so using that version won't help anything :/

      how it is breaking the imageViews:
      i've loaded an image that is 400px x 400px from the applicationDirectory and assigned it to an imageView that is 40px x 40px. normally, that works just fine it shows a smaller , thumbnail'd image if you will. in this latest build it actually shows the full image overlapping other imageViews that are experiencing the same issue.

      and here's the issue that's being warned in the TiDev:

      [WARN] [object TiUIScrollView] has an auto width value of 0, meaning this view may not be visible.
      [WARN] [object TiUIScrollView] has an auto width value of 0, meaning this view may not be visible.
      [WARN] [object TiUIScrollView] has an auto height value of 0, meaning this view may not be visible.
      

      so… can't even test to see if the camera stuff is fixed or not because the imageViews are screwed up :/

      — commented September 2nd 2010 by danno watts
  • I have been experiencing the same, excruciatingly annoying bug. Anyone have a solution?

    — answered September 2nd 2010 by Nick Holland
    permalink
    0 Comments
  • I'm seeing the same issue with 1.4.1.

    There seems to be no pattern to it other than it the crash occurs after the camera has captured and the "editor" is showing. It's not consistent though. Sometimes it works just fine… sometimes it crashes.

    — answered October 4th 2010 by Warren Harrison
    permalink
    0 Comments
  • Maybe it's a timing issue… I'm thinking I might add some delays in the app to see what happens because both the camera and gallery often break the app.

    iPhone 3g - usually breaks;
    iPhone 4 - seldom breaks;
    simulator - always breaks unless editing is allowed on the image

    — answered October 6th 2010 by matt raj
    permalink
    0 Comments
  • Any word yet? My camera app (iPhone 4.1) crashes when taking photos. Help!

    — answered November 9th 2010 by Philip Joyner
    permalink
    0 Comments
  • +1. Please fix this!

    EDIT: I updated my iPhone IOS 4.2 and the problem went away! Yay!

    EDIT2: Nope, now it crashes again.. Retake button is not my friend.

    — answered November 9th 2010 by Nils D
    permalink
    0 Comments
  • Could this be a memory issue? When i restart my iPhone and launch my camera app again, it works like a charm! Every time! But after a while, same thing..

    I've experienced similar problems when using the microphone.

    — answered November 23rd 2010 by Nils D
    permalink
    0 Comments
  • Similar issue with iOS 4.2 and Titanium Mobile SDK 1.6.0
    Does anyone got an idea/solution ?

    Thanks

    — answered February 25th 2011 by Jeremy Sculfort
    permalink
    1 Comment
    • Seems to be working fine for me. Probably a good idea for you (both) to share the code you're using to launch the camera and take a photo. Without that info, it's impossible to debug and help you guys.

      — commented February 25th 2011 by Kosso
  • I used this code and it crashes on device. Please help.

    Titanium.Media.showCamera({

        success:function(event)
        {
          Titanium.Media.hideCamera();
        },
        cancel:function()
        {
        },
        error:function(error)
        {
            var a = Titanium.UI.createAlertDialog({title:'Camera'});
            if (error.code == Titanium.Media.NO_CAMERA)
            {
                a.setMessage('Please run this test on device');
            }
            else
            {
                a.setMessage('Unexpected error: ' + error.code);
            }
            a.show();
    
        },
        showControls:true,
        mediaTypes:Titanium.Media.MEDIA_TYPE_PHOTO,
        saveToPhotoGallery:false,
        allowEditing: true,
        allowImageEditing:true,
        autohide:false   // tell the system not to auto-hide and we'll do it ourself
    });
    
    — answered November 19th 2011 by Ashish Mundra
    permalink
    0 Comments
  • Any word on this? We are experiencing the same issues. Crashes randomly on iPhone 4S. Seems to happen less when the phone is fresh booted and more frequently when a good number of apps are open. Anyone resolve this?

    — answered January 25th 2012 by Joe Liu
    permalink
    1 Comment
    • Version 1.8 of the SDK seems to resolve the issue we were having. We were getting a black screen after memory warnings when opening the camera. This bug report gives more details on the issues. http://jira.appcelerator.org/browse/TIMOB-4221?page=com.atlassian.jira.plugin.system.issuetabpanels:changehistory-tabpanel

      — commented January 25th 2012 by Joe Liu
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.