Skip navigation

iOS app crashes on return from cameraUI - a memory allocation problem?

Nov 24, 2011 12:26 AM

Tags: #memory #crash #ios #cameraui
  Latest reply: myrohit, Nov 6, 2013 10:40 AM
Replies 1 2 Previous Next
  • Currently Being Moderated
    Feb 14, 2012 8:00 AM   in reply to richtretola

    richtretola - Can you take multiple pictures in succession?  It appears to be a memory leak issue that requires multiple uses of the camera to crash.  We've had the issue on the iPhone 4 and 4S but not the 3GS.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 14, 2012 8:09 AM   in reply to saariko

    We've tested both on iPhone 3GS and iPhone 4S. Same result, only it happens quicker on the 3S indicating some memory problem. On the 4S I could sometimes take 4-5 pictures before it crashes the whole app. And it doesn't seem to matter if I take them quickly or wait between each.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 14, 2012 8:26 AM   in reply to LogicOnTap

    Is there any way to fix the issue with the Droid OG? Also, I have seen this occur of the Droid X.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 14, 2012 8:49 AM   in reply to jalsed

    That's odd. For me the problem is much worse on the 4s. It's  1 fail in 6-10 attempts on the 4s and  1 in 10-20 on the 3gs.

    I actually haven't seen the issue on a Droid X but I will test it thoroughly tonight.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 15, 2012 2:09 AM   in reply to saariko

    perhaps I should have gone into more detail. Of course everyone here works for software companies but i would think most of you work for companies that create software for the end user using flex and flash. The company I work for is more like adobe in that it provides a software tool for users to create content with, rather than creating software that is the content itself if that makes sense.

     

    It may be a basic feature, but it's not a priority as a feature over others. Like I said, the majority of apps do not use the camera. So it gets placed lower down the pecking order. That's understandable. I don't think it demonstrates a lack of care to the community, it's just about getting your features prioritized and it would seem that this one is less of a priority than others.

     

    I want it fixed too because I have an app that requires it that I can't finsih yet, but I'm just saying I have sympathy with them and not being able to communicate a release. Mostly the people who have time to post on here aren't the people who have the full control of that release so it's difficult for them to answer the question.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 20, 2012 7:20 PM   in reply to saariko

    For those of you having a problem, are you running with an embedded AIR runtime, or separate download?

     

    Here is what I am seeing (I am running with embedded).

     

    On my stock vanilla 3GS, which has never had any apps installed, I can never reproduce the behavior.  It works flawlessly, no matter how many pictures I have taken (I have tried 20 or so).

    On a friend's 3GS, he had the problem initially, but after closing a few apps everything worked just fine.

    4S seems to have much more persistent problems, but I am still checking that.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 23, 2012 2:37 AM   in reply to saariko

    Maybe obvious, but I found however that there's a clear correlation between opened apps and how fast my iphone 4S crashes when using the cameraUI. So it's definitely a memory related problem.

    Close down all running apps first and I can take several pictures until the problem occur. Have a lot of programs running in the background and the crash might come immediately.

    But I guess it's only Adobe who can fix this problem for us anyway...

    Did I forgot to say please? Please!

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 23, 2012 11:37 AM   in reply to saariko

    I am having the same troubles, though I actually haven't crashed it myself, the client has. They report it happening on iOS and android. I believe the suspect phones are all HTC, if that means anythiing. Using captive runtime with air 3.1. App is pretty much complete except this and scheduled for release in a few weeks....

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 24, 2012 11:50 AM   in reply to saariko

    I have a hard time reproducing the problem.  I have to open a ton of apps, then open 8 safari windows.  That will make it happen reliably, but after that it may fix itself on the next run or not.   If I close some apps, the problem doesn't show up again, no matter what I do (short of opening a bunch of apps again) 

     

    Unfortuately, I am out of options, and I'm abandoning the Flex platform and moving native.  I don't know if anyone from Adobe is listening, but the stability of this platform leaves much to be desired.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 27, 2012 5:15 AM   in reply to saariko

    http://labs.adobe.com/technologies/flashplatformruntimes/air3-2/

     

    Can we PLEASE get an update on whether the above addresses these issues?

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 27, 2012 2:21 PM   in reply to shanlyticketsolve

    Using CameraUI we were lucky to take a single photo on an iPhone 4S.  Building against 3.2, I have tested taking 20 pictures in succession without a crash.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 27, 2012 4:17 PM   in reply to ChristopherTotty

    This sounds promising, but I wouldn't count your chickens too soon.

     

    As long as too many apps are open, I have never had anything crash.  If I get a crash and then close some apps, the camera works forever for me.

     

    Can you try loading up the iPhone with a top of open apps, and a full load of Safari pages and see if you can get a crash?

     

    I'm willing to try with the new runtime, but I don't see how to make Flashbuilder use the newer runtime.  Any suggesitons?

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 27, 2012 11:51 PM   in reply to saariko

    I don't mean to stress you guys, but I've released a app already on appstore, and the whole point of the app is to take pictures of houses so that you can add screenprotection.

    Here's the link to the app: http://itunes.apple.com/us/app/markisguiden/id501972251?mt=8

     

    Currently, I'm getting a _lot_ of complaints from users that report the app crashing when they're taking pictures, and I'm looking like a fool now for choosing air

     

    I would like to know if 3.2 fixes this?

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 28, 2012 6:06 AM   in reply to AlexK777

    Just loaded up an iPhone 4 on which I was also experiencing the same issue (crash on almost every pic taken).  Loaded up about 10 apps above what I already normally had open, including a full set of pages in Safari.

    Still was able to take 20 pictures without a crash.

     

    In order to use the current Air 3.2 release candidate in your own build you should follow these instructions:

     

    1. Download the Air 3.2 SDK release candidate for your computer (Win/Mac) from this link: http://labs.adobe.com/downloads/air3-2.html
    2. Locate the sdks folder in your Flash Builder install directory.
    3. Make a copy of the Flex 4.6.0 folder and name it something like "Flex4.6.0Air3.2"
    4. Unzip the entire Air 3.2 SDK directly in your copied folder.
    5. Load up Flash Builder and choose Window -> Preferences.
    6. Under Flash Builder -> Installed Flex SDKs, choose Add...
    7. Locate the folder you created and name it something like "Flex 4.6.0 With Air 3.2".
    8. Right click your project and choose Properties.
    9. Under Flex Compiler or Flex Library Compiler choose "Use a specific SDK" and select the Flex SDK you just added.
    10. Clean and Export Release Build.  Choose to "Export application with captive runtime" if deploying as an Android APK.
    11. Your IPA/APK should now include Air 3.2!

     

    Keep in mind that while this is a release candidate, it is not the final release of Air 3.2.  Although Adobe is encouraging the use of this build in a production environment, you should exercise caution before deploying an app to the App Store / Android Market using this build.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 28, 2012 10:05 AM   in reply to saariko

    Yes, this latest 3.2 release seems to have resolved this for me too (iphone 3gs). Thanks Adobe.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 28, 2012 8:27 PM   in reply to wedgedkc

    Hi,

    The AIR 3.2 SDK available on labs has the fix for the CameraUI crasher. In case any of you are still able to reproduce the bug in any scenario, please file a new bug with the sources and the steps to reproduce the bug.

     

    Thanks,

    Sanika

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 28, 2012 8:48 PM   in reply to sanika Kulshreshtha

    Thanks, Sanika!

     

    Another successful report here.  I have been unable to reproduce the bug with AIR 3.2.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 29, 2012 1:00 AM   in reply to saariko

    Great news Sanika!

    I'll make an update and send to App Store, thanks

     

    Edit: Did a lot of tests and no crashes, almost uncanny timing  since I got notified about the camera crashes yesterday

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 2, 2012 5:57 PM   in reply to sanika Kulshreshtha

    I guess I spoke too soon.  Having the crash issue, 100% repeatable on a Droid 3, even with the new runtime. 

     

    Steps to reproduce:

     

    1.  camera.launch(MediaType.IMAGE);

     

    I'm done with you Adobe.  Thanks for wasting my time.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 2, 2012 6:02 PM   in reply to AlexK777

    Was it all a waste? Wasn't some of it entertaining?

     

    Meanwhile, back at the crash...

     

    The one that we've all talked about is iOS specific. If you have an Android crash you should report it.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 2, 2012 6:51 PM   in reply to Colin Holgate

    I know the title of this thread is iOS specific, but people have been reporting the same exact bug in Android in the thread as well.  I just want to caution people reading this thread for any reason, that the new runtime doesn't fix the Android bugs.

     

    But this has been a major waste of time -- all that time learning Actionscript.  It was an attractive idea to have one codebase for each platform, but not worth it for such a bloated runtime, and an apparent lack of support for the breadth of platforms.  Even this recent runtime fix has been in running since early November.   I could understand this if I was doing something exotic, but crashing simply on a return from the camera?

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 29, 2012 1:20 AM   in reply to AlexK777

    Yes, i still have the same bug in Android (SGS2, ICS 4.0.3).

     

    Just crashes to desktop when i press the button with the check-sign (select).

     

    my code is below. I never get the "Camera UI Complete", i just return to the desktop.....

    I will try to publish this to iOS in order to see if it works there..

     

    private function onComplete_cameraUI(e:MediaEvent):void {

         trace("Camera UI Complete!!!");

    }

     

    private function onClick_takePicture(event:MouseEvent):void {

         if (CameraUI.isSupported && !ui) {

              ui = new CameraUI();

              ui.addEventListener(MediaEvent.COMPLETE, onComplete_cameraUI);

         }

         if (ui) {

              ui.launch(MediaType.IMAGE);

         }

    }

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 12, 2012 5:56 AM   in reply to ChristopherTotty

    excelent work

    did work for me!

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 13, 2012 8:15 PM   in reply to Marijn83

    I put in a bug report in bugbase.adobe.com for this issue (#3134550).  Maybe if a few people vote for it, it will get more attention.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 20, 2012 4:15 AM   in reply to saariko

    Here's a thing:

     

    I have the same problem while testing on a Samsung Galaxy Tab using AIR 3.2 (havn't tried 3.3 Beta yet). Changing the camera settings has no effect (i.e. using low-res image still crashes app). However, if I switch the render mode to CPU then the crash doesn't occur. Unfortunately, then the rest of my app runs much slower. Vexing to the max.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 20, 2012 5:22 AM   in reply to saariko

    Ah-ha!

     

    Here's a fix that's resolved this issue for me (see previous post):

     

    Simply call System.gc(); at the point in your code where the data is returned from the CameraUI. This forces garbage collection (generally you are advised against doing this) and free up enough memory so that app no longer crashes.

     

    Big up to Dan Gronell of DLG Software for this post: http://dlgsoftware.com/AIRAndroidMemoryIssues.php which is where I gleaned this nugget of wisdom.

     

    Surely this is something that Adobe could factor into the CameraUI for the next AIR release to make it more stable so that this hack (and it is a hack) is not necessary.

     
    |
    Mark as:
  • Currently Being Moderated
    May 17, 2012 9:20 AM   in reply to kamunk1

    Any of you guys still getting this error with Android devices? I have implemented the System.gc() ;  hack and even with this my app crashes to the phone's  desktop. I'm testing on a DroidX with 500mb of RAM. What I think is happening is that my total memory even before I run the app is only 79M available of 404M. Running my app and selecting an image from the photo roll is almost an immidiate crash.

     

    The only resolution I can find is to look at my running programs and shutdown all existing running programs on my droid and then rerun app and then usually it doesn't crash. I'm starting to think this problem might have more to do with mobile devices not having sufficient enough memory in the first place.

     

    In my findings if it is related to memory RAM on devices and not memory leak issues then Adobe is not going to be able to do much if anything about it.

     

    Thoughts???

     
    |
    Mark as:
  • Currently Being Moderated
    May 17, 2012 9:31 AM   in reply to cctman1

    Yes, this is still an issue.  I have a bug opened in bugbase here:

    https://bugbase.adobe.com/index.cfm?event=bug&id=3134550

     
    |
    Mark as:
  • Currently Being Moderated
    May 17, 2012 10:08 AM   in reply to wxsouth

    OK... well here is some further info I dug up. I just got off the phone with Verizon and their two newest phones are Razor's Edge and Razor which apparently are both using 1G RAM. So they should be OK, but for the majority of us Android users were probably on DroidX/2 or older Android devices. So were running nomore than 500MB of RAM. The tech guy told me you can't just replace or upgrade the RAM on these devices. This being the case then were right back to where we started. The manufacures can't update the devices and unless you buy a brand new phone your basially screwed.

     

    So why did Adobe release Camera Roll, Camera functionality in the first place if this is a prevelant problem on almost all Android devices at or under 500MB? They should have just left the camera functionality out of the API all together and called it unsupported until they got this all straightned out. There is no excuse for Adobe to have release camera support in the AIR API for Android when this issue is so easily replicated.

     

    Anyone have any ideas on how to get around this problem? I'm completely out of ideas after a couple months of banging my head against the wall. It looks like Adobe is the only ones that can fix this now.

     

    FYI.. The System.gc() hack helps but does not prevent the issue.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 28, 2012 3:13 PM   in reply to kamunk1

    the system.gc() helped my IOS targetted app, but it didn't eliminate it completely. When I have all background apps NOT running the problem doesn't occur. This is not good... you can't tell your users..oh yeah.. there is a bug.. so just shut down all apps before you use mine.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 2, 2012 7:00 AM   in reply to saariko

    I get this sometimes crash when returning from the sms composer (native extension).

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 2, 2012 9:37 AM   in reply to luke_luke_luke

    Are you using sms composer extension with Phone Gap or Flex mobile?

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 2, 2012 9:48 AM   in reply to cctman1

    im not using phone gap but what exactly is flex mobile. ?
    My app is mobile air iOS app made with flash cs6.
    thankyou

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 2, 2012 4:18 PM   in reply to justabust

    I used the latest sdk release and resized my photos after taking them and it eliminated the problem. When I ran my app through some performance testing tools I found that each photo was eating up huge amounts of memory. In addition I made sure to dispose some objects manually as well as force the garbage collector and all seems well now.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 6, 2013 10:40 AM   in reply to justabust

    Hello justabust,

     

    I think your solution will work for me.

    Can you please share the code how did you manage to solve this problem, Actually i am unable to use this solution.

     

     

    Thanks

     
    |
    Mark as:
1 2 Previous Next
Actions

More Like This

  • Retrieving data ...

Bookmarked By (1)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points