[TIMOB-12848] Android: Using the camera on certain devices causes the app to crash
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-08-29T21:08:52.000+0000 |
Affected Version/s | 2013 Sprint 09 Core, 2013 Sprint 09, Release 3.2.0 |
Fix Version/s | 2014 Sprint 05, 2014 Sprint 05 Core, Release 6.2.0 |
Components | Android |
Labels | qe-closed-3.3.0, triage |
Reporter | Justin Lewis |
Assignee | Gary Mathews |
Created | 2012-12-17T05:46:41.000+0000 |
Updated | 2018-08-31T14:32:11.000+0000 |
Description
Call Ti.Media.showCamera and the camera opens up fine, takes the picture fine, then click ok, and the app crashes before reaching the success function.
The picture does manage to get saved into the photo gallery.
Sample code. Paste this into a new Android application.
var win = Titanium.UI.createWindow();
var imageView = Ti.UI.createImageView({height: Ti.UI.FILL, width: Ti.UI.Fill});
win.add(imageView);
Titanium.Media.showCamera({
success:function(event)
{
Ti.API.info('#### Camera Success');
var cropRect = event.cropRect;
var image = event.media;
Ti.API.info(image.length);
var filename = Titanium.Filesystem.tempDirectory + "/"+ 'camera_photo' + new Date().getTime() + ".png";
Ti.API.info(filename);
var f = Titanium.Filesystem.getFile(filename);
Ti.API.info(f.nativePath);
if (f.exists()) {
Ti.API.info('The file exist , trying to delete it before using it :' + f.deleteFile());
f = Titanium.Filesystem.getFile(filename);
}
f.write(image);
alert('Camera Success! The file size is '+f.size+' bytes.\n Now trying to assign it to an image on the screen (this may fail for hi res images)')
imageView.image = f.nativePath;
},
cancel:function()
{
Ti.API.info('#### Camera Cancel');
},
error:function(error)
{
// create alert
Ti.API.info('#### Camera Error');
var a = Titanium.UI.createAlertDialog({title:'Camera'});
// set message
if (error.code == Titanium.Media.NO_CAMERA)
{
a.setMessage('Device does not have video recording capabilities');
}
else
{
a.setMessage('Unexpected error: ' + error.code);
}
// show alert
a.show();
},
allowEditing:true
});
win.open();
Attachments
File | Date | Size |
---|---|---|
camera_crash_android.txt | 2017-02-04T14:04:44.000+0000 | 432432 |
Hi Justin, Thanks for the report. If you could provide a reproducible test case then I'll see about escalating this. Cheers.
The KitchenSink app shows this behavior on my Motorola Droid HD Maxx.
Allow me to help a little: http://developer.appcelerator.com/question/143949/camera-shuts-down-application
The success event is never fired. The app restarts, no exception is thrown, coming back from the media intent. This occurs with the camera and from the gallery both. Sometimes the device logs shows an error about the intent being 'out-of-order'. Used Kitchen sink code in full from github. Used a stripped down single file sample of the kitchen sink code (added image view since on high end systems, an out of memory error is tossed when trying to load a 3mb image as the window background) https://gist.github.com/4527649 Client is testing on a Razr Maxx running 4.1.2 Sample code built with 2.1.4 and 3.0.0GA
Is there any update, or ETA on this?
Lost a client over this...
I will escalate this now. Sorry for the inconvenience.
I see this is marked as a regression. When did it last work for people (if known)?
I've never seen this functionality work. I've been developing with Appcelerator since November of 2012, I don't remember the released API version then. Since then I've used tried every released version of the API, and I've tried several development versions with no luck.
Ingo, Sample code listed above works on some devices, but fails consistently on the Razr Maxx, occasionally on the DroidX, never on an S3, Droid Pro, or a Droid 2. One client dumped Titanium curses Appcelerator's name at every opportunity because of this, and the MULTI-MONTH queue delay didn't help. sf
Verified the issue on Motorola droid Razr HD running android 4.0.4 & I am able to reproduce the issue. The kitchensink app crashes & restarts as soon as we take the pic & finalize it. Also, pic taken gets saved in the picture gallery of the device. I noticed that after taking the pic we have to finalize it by taping on a tick mark, which is not so common on many phones.Not sure whether this would be causing the crash. Verified the issue on the environment below: Ti sdk : 3.0.0 GA Ti studio : 3.0.2 stable App used : kitchensink
https://github.com/appcelerator/titanium_mobile/pull/3992
Was this tested on a RAZR Maxx? I pulled the latest SDK (3.1.0.v20130327075056) from the CI builds and found that the camera crashes as soon as our app calls it. Other non-Moto devices that we tried seem to work properly. That is slightly different than the symptoms which created the ticket but it certainly doesn't appear usable yet either.
This was only tested on a Droid Razr HD. We don't have a droid RAZR MAXX available. Do you have a log the error that occurred?
So glad I didnt email the client we lost and tell then you all had actually fixed this. 'Motorola Droid HD Razr Maxx running Android 4.1.1' vs
We don't have a droid RAZR MAXX available.
I have tried this on the Droid Razr Maxx HD 4.1.2 (There isn't a easy way to downgrade to 4.1.1) and it worked fine for me. I am able to take the picture, save it, and open the image according to the test case provided https://gist.github.com/4527649 I also tried the Kitchen sink test and that worked fine as well. [~jeromywaldron] Please use the build 3.1.0.v20130402092426 or later from the CI server and test again. That was the build that I used to test.
I confirm I encounter the same issue with Sony Xperia Z, Android 4.1.1 and SDK 3.1.0.
[~renaud] Can you please provide more information on this? Were you using 3.1.0.GA, or some custom build from CI? Which android version is your phone? Do you have logs relating to the crash? Which test case were you using? What is the behavior, does it crash and exit... or just hang?
I confirm the issue on my Nexus S(Android 4.2.2),built and application with the feature to choose pictures from the android gallery.It restarts the app sometimes without throwing any sort of exception Using the latest titanium SDK.Same happens on Sony Xperia U running on Gingerbread EDIT: I can't believe that such a critical bug still happens to exist in the SDK while the appcelerator people are busy marketing their service as high quality cross platform development!
Why can't you people release an important fix for this bug!! I am still waiting for your supposed fix of 3.2.0! I downloaded the master and its not fixed in it.Cmon release a GA today!!!!!!
Here how I fixed it programaticaly: It's a bit specific to my app and it's not perfectly coded but it seems to work on all Android devices and iOS. note: callback should be function with a blob parameter.
Hi, I have encountered the same bug, I have tested my app at two different android devices, at Samsung Galaxy S2 with android 4.0 and at Samsung Galaxy Ace with android 2.3, everything works fine with Samsung Galaxy S2, but in Galaxy Ace the app restarts when I select an image from gallery or took a picture, I have tested with TI sdk 3.1.1.GA and 3.1.2 CI. I am wondering if it is a problem whit the latest upgrade of android sdk tools (android sdk tools 22) Such a shame that appcelerator have critical bugs like this unresolved from several months ago.
Again, apologies for the delay. We can't pick up every Android device, nor do we have every device in every configuration. We are attempting to procure devices that reproduce the issue which is why it has taken as long as it has. If people are local to Mountain View, we welcome individuals to stop by our office with a device that causes the problem so we can figure it out. Alternately, if you can file a patch that you believe fixes it, great. However, so far, the patches we have gotten have solved it in certain circumstances, so we can't use them universally.
@Ingo We can all see that this issue relates to four different issues and in all of the issues the person concerned comments to watch this thread.This means that this issue is *more critical* so it should have been taken seriously within few weeks of it being filed.I can't understand ,is the business of the company so slow that it can't invest on devices at the earliest ? please excuse me for the bravity,but there are a lot of people who are {color:red}*loosing clients*{color} for this bug.That can be taken as a loss in business of developers who have chosen appcelerator over phonegap and native code. Please fix it as soon as you can.
Ingo is saying they can't seem to procure the specific devices & configurations that cause the problem. If the problem is critical to you, and you can reproduce it, let them borrow your phone. UPS can even get it there overnight.
[~nezam] As Shannon mentioned, we have tried this on many different devices, including the specific ones that people mention, and have been unable to reproduce the issue. We spend significant amounts of money each month on procuring existing and new mobile devices, but it is just not possible to have all devices in all configurations. Just yesterday we tried this on a Sony Xperia U with no success. This leads me to believe that it's either a problem where the test case we have is wrong, or the configuration is a mismatch. Your statement leads me to a few questions:
If you try the test code in the description of the ticket, does it reproduce the problem. What are the exact steps you followed?
If not, what is the test case we can use that _does_ reproduce the problem for you?
In either case, we need any crash logs you can provide
Thank you for your assistance.Unable to reproduce on Sony Experia U running 2.3.7 and sample code in original post. I did change line 2 from Ti.UI.Fill to Ti.UI.FILL. I tried various scenarios, sleep/wake, let the camera sit while active, took many photos. I could not reproduce but we did encounter some strange behavior The sample code does not have "save to gallery" set, so the images from the camera should not be saved to the gallery. In the first few shots while testing, what looked like sample images where shown instead of my photos. For these cases, the images were saved to the gallery. After around 3 shots like this, my photos began being displayed the actual photo after the photo was taken, and these photos were placed in the gallery in a "_tmp" file. These photos were not saved in the gallery, as upon revisiting the gallery the image was not there. We will investigate these issues discovered and continue to try and reproduce the crash. Our device was delivered with no SIM, we will add one and retry, then discuss moving from 2.3.7 to another OS to continue trying to reproduce.
Hi everybody, I have tested today again with the latest Titaniun sdk continuous build (3.1.2.v20130629) and looks like the bug of take a picture with the camera have been solved, at least at Samsung Galaxy Ace, but I still having problems when I want to select a picture from android gallery, the app open android native gallery but when I choose a picture it restarts my app at the same way that the bug of taking a picture did, I have also used Titanium SDK 3.1.1.GA and I have the same problem. What can I do? please I need help with this. Device: Samsung galaxy Ace TI SDK: 3.1.2.v20130629 Here's my code:
self is a window
After many wasted days, this is the fix that works on emulator and device :)
handle_listing is the function you can use to manage the image.Fix for Camera Snapshot
Fix for Gallery Image
Hi All. No matter how hard we try and what devices we purchase, we can't reproduce this. Does anyone have this issue and is located in the SF Bay Area who could drop by our office?
Ran the code in the description on Sony Xperia J ST26i running android 4.1.2. We get a success alert & the app does not crash.Pics taken from the device camera are successfully saved in the gallery. Environment: Appc Studio : 3.2.1.201401281409 Ti SDK : 3.2.1.v20140128171647 Mac OSX : 10.8.5 Alloy : 1.3.1-beta4 CLI - 3.2.1 beta3 Sony Xperia ST26i - android 4.1.2
Ran the code in the description on Sony Xperia J ST26i running android 4.1.2. We get a success alert & the app does not crash.Pics taken from the device camera are successfully saved in the gallery. Environment: Appc Studio : 3.2.1.201402061120 Ti SDK : 3.2.1.GA Mac OSX : 10.8.5 Alloy : 1.3.1 CLI - 3.2.1 Sony Xperia ST26i - android 4.1.2
So far, no matter what device we try, we can't reproduce it. If anyone has a device that they are willing to loan us, we will pay for shipping the device here and back, as well as some swag in the bogs. Otherwise, we will be forced to close this as "cannot reproduce".
Given that a number of people (including us) with this issue can no longer reproduce it, I am going to call it fixed by previous commits to this ticket, or related tickets. There is a different, less severe behavior going on, as documented in TIMOB-16524. That ticket will be used for tracking this fix. If anyone still can reproduce this issue, we need the following:
An exact test case
The specific device (make, model, OS) that reproduces the issue
A willingness to possibly loan us the device for a short time if we do not have it in house. We will pay for all expenses related to shipping.
Thank you to all of those involved in helping us try and understand the cause of the issue here.Verified fix with below environment: Appc Studio: 3.3.0.201404241755 SDK build: 3.3.0.v20140424130915 acs: 1.0.14 npm: 1.3.2 alloy: 1.4.0-dev CLI: titanium-3.3.0-dev titanium-code-processor:1.1.1-beta1 Xcode: 5.1.1 Osx: Mavericks(10.9.2) Device: Nexus 5(4.4.2), Nexus 7(4.3) App does not get crash using camera on above devices. Hence closing the issue.
This appears to have been closed despite the tests to confirm it works being performed on devices that were not mentioned as causing the problem in the first place. Have any checks been made specifically on those devices mentioned above? The problem appears to be related to devices that are not considered the gold standard - but rather those device with less sales. This problem was found on Motorola devices, but we also know that sony devices have also had Android camera issues. Given the length of time this ticket has been around and the number of camera related issues with Android devices over time - I imagine this ticket has been closed prematurely due to the lack of testing against those devices that actually exhibited the problems.
I'm going to instead resolve this to HOLD. [~core13], yes, we've tried it on the devices we have as all as specifically purchasing devices mentioned here as causing the issue. We are now down to asking someone to loan us one of their devices that cause the issue. We will PAY to ship it to us, and PAY to ship is back, AND include some nice swag in the process. I first made this offer a year ago, and no one has stepped forward. This leads me to believe that some other change we made in the meantime may have fixed the problem. But if anyone has a device, please let us know.
Hi Ingo, I'm having the same problem with the camera in some devices. The app is crashing when clicking the save button in the image preview, the success event is never fired and the app restarts. In some devices works fine but in others not. Next you will see my development enviroment configuration and a list with devices with and without error. I can't send you any devices because the devices are from our customers. Sorry, I'll try to find a device with this error to send you, but it will be complicate. Environment: ---------------- Titanium Studio, build: 3.3.0.201407100905 Titanium CLI: 3.3.0 Titanium SDK: 3.3.0 GA Devices WITH ERROR: ----------------------------- Samsung Galaxy FAME GT-S6810P Sony XPERIA Z2 Samsung Young mini Alcatel One Touch 4033x Devices without error: --------------------------- Samsung Galaxy S3 mini GT-I8190N Samsung Galaxy 4 Xiaomi Mi 3 Xiaomi Mi 2s Sony XPERIA S Any help/suggestions will be appreciated. Thanks
Thanks for the feedback. Yes, unfortunately, we need an actual device that can reproduce the issue. We've tried buying exact devices, and that hasn't even helped.
Hi, I can confirm this issue still exists, I can reproduce using the pure kitchen sink code: More often than not my app crashes/restarts after clicking the confirm/save button of the device camera - the success handler of my app never gets called. For Titanium, I'm using the latest SDK/Studio version at the time of writing: 3.3.0.201407100905 It happens on my Samsung Galaxy S3 (Android 4.3 Jelly Bean) as well as on my brand new Moto G (2nd generation, Android 4.4 KitKat). It happens after a fresh install as well as after restarting the app and without being connected to Titanium Studio. Btw, I've the same issue with PhoneGap. Any news how to solve this? Seems to be some kind of memory issue, the app gets garbage collected in the background when the camera is active. In PhoneGap there are some inofficial plugins solving this issue with some kind of "foreground" magic keeping the app in the foreground so it does not go into onPause or onStop state and thus cannot be garbage collected. Issue seems to happen less when the phone is fresh booted and more frequently when a good number of apps are open. Cheers, Philipp
[~bicpi] Thank you. As mentioned before, we're looking ideally for someone in the Mountain View area that can stop by our HQ and work with the engineers there to reproduce this.
Hi, I would really love to come by and show you the issue on my devices, but I'm too far away in Europe ;-) But I've created a screen recording with the Moto G: http://youtu.be/1X47O6K5eqM Here's a thread about the same topic using PhoneGap; seems to be Anroid related, not PhoneGap or Titanium: http://stackoverflow.com/questions/8368091/phonegap-camera-restarts-the-application/9524643# But it seems to be solvable with this (outdated) plugin: https://code.google.com/p/foreground-camera-plugin/ or with this more recent adaption of the same plugin: https://github.com/shaithana/cordova-plugin-wezka-nativecamera I've checked with the latter and it worked. It's definitely something with the memory. After a fresh restart of my device, it worked fine. But one hour later, after using some other apps, the issue started again. The only intention of the app I'm currently developing is to take one or more pictures and send them to a server. So it's a real showstopper for me right now. Does it really never happen on your (low end) test devices? Thanks, Philipp
I was able to improve my experience with this issue a little bit. First, while using a screen recorder I cannot take a single pictures, it always leads to a restart. So this is a bad idea. After deinstalling some Apps, including Skype, a restart and implementing some code to only show small thumbnails of the pictures, it worked quite well and I was able to take 20 pictures in a row without a crash. But after an uptime of some hours while using the phone normally, it startet again. I was only able to take 0-5 pictures before the crash. Philipp
For WebView, this is a confirmed behavior on a lot of devices, see https://code.google.com/p/android/issues/detail?id=53088 => Open web app in browser => Simple file input opens camera (no JS involved) => Browser tab goes into background => Android kills Browser tab to free memory (because of Android's design) => On return to the (web) application, Browser tab gets reloaded => State of the app is lost, taken picture cannot be processed Maybe it's some kind of similiar behavior for Titanium.
Guys PLEASE. This is a showstopper problem for ALL developers using Titanium! The problem is easy explained: * titanium calls the native camera * on low ram devices or on android versions more aggressive on memory management, android kills the background app waiting for the image. Simple as this. So, how do native developers manage this? There will be MORE AND MORE devices subject of this bug. My new Moto G second edition, a 2014 kitkat phone, kills the app as soon as the pic is taken, cause it needs ram to store the image. More devices will be like this, please Fix this thing. Or a lot of developers will move away from Titanium. And, to Philipp, neither phonegap is immune. The "native" plugins are really buggy... and unmaintained. Appcelerator guys, let us know something on this bug, PLEASE!
[~xcash] Please read the above threads.
It appears to be a native bug with Android.
We can't reproduce this on any device we have, and we have bought many to reproduce this bug.
If you run into this issue and can send/ship us a phone (we'll pay for it), we would be gratefulI agree! I have a 200k users App and the #1 major complaint is about Android crashing when taking pictures! This is long overlooked and really should be prioritized.
I have just reproduced the test case of this issue on a brand new Moto G (2nd gen) (XT1069) running Android 4.4.4 (kitkat) The testcase was compiled using Titanium 3.4.1.GA with default tiapp.xml The device has some apps installed like Facebook,Twitter, Gmail, etc... it is under a "normal" usage pattern... (running latest firmware and all apps updated to latest version) I can send you guys the device, but I'm on Brazil and I'm afraid the shipping costs will be very high. If you guys want I can collect lower level logs with Android Monitor, run debug apps, etc... Any way I can help solve this?
On android monitor, logcat reports some low level camera related errors:
more logs: (there is some Android related trash along the relevant logs, but we can get a glimpse on several camera related stuff and some buffer error messages)
The following logs are from Google Play Developer console itself, and are coming from my app in production. those logs are generated when the users have problems taking pictures (app crashes just after picture is taken): java.lang.ClassCastException in android.widget.AbsListView.onRestoreInstanceState by device Xperia S (LT26i) 1 4.8% Galaxy Grand duos (baffin) 4 19.0% DROID RAZR HD (vanquish_u) 1 4.8% Moto X (ghost) 1 4.8% Optimus L5 (m4) 2 9.5% Optimus 4X HD (x3) 1 4.8% Galaxy Core 2 (kanas) 1 4.8% Moto G (titan_umtsds) 1 4.8% Galaxy S4 (jflte) 1 4.8% Moto G (falcon_umtsds) 1 4.8% LG-P875 (l1e) 1 4.8% LG Optimus L5 II (vee5ds) 1 4.8% LG Optimus L1II (v1ts) 1 4.8% LG Optimus G Pro (geefhd) 1 4.8% Moto G w/4G LTE (peregrine) 1 4.8% Galaxy S3 Mini (golden) 2 9.5% by Android version Android 4.4 7 33.3% Android 4.1 7 33.3% Android 4.2 4 19.0% Android 4.0.3 - 4.0.4 3 14.3%
Ingo the "not reproducible" is just hilarious. I was invited to an Appcelerator presentation with one of your SVP and he was telling the world about how Appcelerator is big, good and shiny. And a multimillion company. I believe that. I like working in Titanium. Almost all the time. But when we, developers that made a choice on a platform, face a bug like this. A stupid problem like this i would say. Well.. where are the "multimillions"? Where is the Gartner magic quadrant? This is only the task of taking a photo in the first mobile os. I, and others, said this is happening on a lot of devices... I have this problem on my MotoG Second edition, a mid 2014 phone. You can't find this phone??? Motorola is shipping it right now in the US from their site in 2 days! Cmon. Why one would buy Appcelerator Platform if the basic things are a nightmare? Ygor did a great job on listing devices and collecting errors. Probably a lot is related to the saving/restore state thing. I'm really not good in Java so I can't help debugging native code or i would've helped in a more constructive way.
I can hardly believe that it is not reproducible. It is Android related, but how do native developpers solve this issue. I cannot imagine that this is a common issue on native Android apps? Btw, I've experienced the same issue with a plain HTML page using an input field of type file which accepts image/* data- Camera opens and after taking the picture and returning to the app, the browser tab reloads. This happens on my S3 and my Moto G (ALL the time) but not on an iPhone or IPad. Philipp
[~xcash] This is not a constructive way to have a conversation. The reason this issue is not resolved, is both not for lack of trying, nor for an unwillingness to solve the issue--you may note that the priority still says "Critical." As I have said before, we HAVE bought phones people say can reproduce the problem. And we can't. Including ones on Ygor's list. I've also said if someone HAS a phone that does demonstrate the issue, we will buy it and pay to ship it, an offer I made as far back as April. If you have a MotoG Second edition that reproduces the problem, we'll buy that one and pay for the phone and shipping. [~bicpi] You mention that using the https://github.com/shaithana/cordova-plugin-wezka-nativecamera plugin solved the issue for you (after a fashion)?
Ingo, I'm not here to blame anyone. I'm here to find a solution and to help other developers facing this issue. Eventually in January I'll be happy to ship our phones reproducing the problem. Meanwhile i was debugging this thing more deeply. As I said before this is related to the saveState and resumeState pattern around an Intent call. I don't want to speak too early but i'm nearly ready to publish a workaround that seems to work (and since it's a workaround it will have some disadvantages but instead of being unable to take photo...). The plugin mentioned by Philippe doesn't resolve the issue, it simply does a different thing: It creates a custom camera app inside the native app. This means the plugin needs to be maintained to support every new camera features and such things. Later i'll post the workaround when finished and tested.
I have to chime in here. Sorry. Appcelerator has SOASTA ( Appcelerator Test). It can use devices remotely. Could someone with the affected hardware just coordinate with Ingo and let AppC debug remotely? I had no idea that this was a long standing bug. This has never come up in any of my training courses. I have however had a camera on Android take too high resolution of an image and have **that** crash the App. **Out of curiosity to those who have this issue, try setting your camera to 8 Mega Pixels.** Does it still crash?
Here it is. Finally a *workaround*. What I discovered is that, on the affected devices, the app seems to be destroyed right after the intent is called. From my logs the activity's lifecycle (from a Titanium point of view) is: onCreate -> onStart -> onResume (start the camera intent) -> onPause -> onStop (here the app activity gets destroyed *but no onDestroy callback is called* ) (the user here is not doing anything, native camera app is showing up and waiting) When the camera returns (cancel or success, no matter) the app goes through a full restart: onCreate -> onStart -> onResume. My workaround: * use the intent passing a file url on externalstorage where to save the image. * set an app property in Ti.App.Properties to do a kind of "savestate". Just a boolean "waiting_picture". * add a callback on Activity's onResume to handle the resume step checking for the above property. * in case of that property present, search for the file and use it. * and of course the code to manage the case when the app doesn't get destroyed and the intent callback is called. You can find a workaround example (it's self-explanatory) here: https://gist.github.com/xcash/e0e363e04999ba9c8ad2 I'll be improving it later but it's fully working. For any questions feel free to contact me commenting that gist or here in this issue. Of course the users will see the app restarting (splash screen and everything) but it is what they're seeing already now.. except for the picture taken instead of a buggy feeling. :) Hope this help. PS: [~sophrinix] no i was taking pics at 6MP. Seems on some new devices the native camera app is eager for resources, and android is brutal in destroying app.. :D
Ingo, do you guys want me to send the Moto G 2nd gen ? I'm in Brazil - Sao Paulo... I understand that you have a local business office here, if somebody from here is going to US in the near future I can drop the device with them. Would it help?
Hi, some news about this issue??? :(
[~ingo] I can reliably reproduce this on my Nexus 6. I'm in Mountain View. Happy to come by. 4.0.0.Beta3.
Tried this with the following:- Titanium SDK: 3.5.1.GA, 4.0.0v20150429154210 Nexus 6 (Android 5.0) Not Reproducible. Used the code:-
I have been able to replicate the issue in Motorola XT1032 and Motorola XT1064 using the code above, its a random issue. It happens 1 in around 30 attempts. I think is a memory issues so there are chance if your app is using too much memory, you have lot of background tasks or your camera is set to extremely high-res it will fail. In my company we're having lot of problems with this issue, about 20% of our Android users have reported issues related to camera crash, we have discovered an easy but graceful fix is reboot the device. Also users with new phones with cameras with high resolution seem to have more problems. Attach a sample of code used for capturing photos and resize images using third party modules.
I'm also working on a camera module able to set specific resolution when using camera reducing memory usage ([https://github.com/rpavez/ti-camera-pro]). I still haven't been able to include system camera controls and I'm also having issues with layout of views added to the ViewProxy. *It would be awesome if somebody with more experience could help me fixing this issues with my module*
[~msamah] Can I assume you are testing multiple times in multiple real world scenarios of usage with different apps starting and stopping to see what happens outside of a clean environment? Did anyone take up [~athorne] on his offer to come in and show you in person a repeatable test case to help this very long term issue finally get some actual traction?
[~core13] and [~athorne] yes, I would like to invite Alex into the office and will do so ASAP.
Great news! Say the word.
Any update of this?
A little while back [~ingo] and I talked about them buying our device that has the problem. I'm assuming he's just busy right now. I wrote him just to check in.
Hi, I can confirm this still happens in some devices, Nexus 5 with Android 6, Moto G with Android 5. The log just shows android restarting the activity, no errors. It doesn't happen every time, sometimes it works, sometimes it doesn't, which sucks.
Happens with Nexus 5X, 6, and 6P as well. And, the camera won't work until the phone is restarted after this happens once. Fails with the log line "cannot connect to camera service." Is camera2 upgrade in the plan at all?
On the 5x, camera can lock up after as few as 3 images. No, don't have time after 3+ years to continue to submit details and sample code, simply adding a comment so that Alex knows he isn't alone.
I can confirm that our app also crashes on a Nexus 5X. We are using Android 6 permissions correctly as our app seems to run okay on other Android 6 devices. We don't have a 6/6P to test, so I can't speak to those devices. It appears that the Ti.Media module is not properly releasing the camera. It's also using older/deprecated APIs and needs to be updated overall.
[~timpoulsen] That sounds bad that the Ti.Media is not releasing the camera. I do agree that we we need to update the camera API.
@msamah Perhaps you would also consider implementing the functionality of https://github.com/skypanther/picatsize in such an update. _PicAtSize is an Android module that lets you take a "PICture AT a SIZE" you specify._ Basically, I took the existing Ti.Media code and turned it into a module, then with a lot of help from others, extended it to support the
camera.getParameters.setPictureSize()
method. In this way, we can avoid out-of-memory errors by eliminating the need to resize photos in the JavaScript space. I'm not much of an Android dev, my code is not PR-worthy, and I probably couldn't make it PR-worthy. But, the code is Apache licensed and mostly your code already. So, feel free to take whatever you want.Roger that [~timpoulsen]. Thanks.
I am seeing this same issue on an ASUS ZenFone 2E, Android version 5.0.1. It will be great to have a fix for this to improve user experience... Thank you!
We see this happening most often on a Samsung galaxy S5, Android 5.0 on Verizon. There are other variants, but this one is the most consistent. Can we create a branch and PR for this issue? I would like to help solve this issue.
I have also this problem on Motorola MotoG2, Android 4.4, TiSDK 5.3.0 GA, picking up image from gallery works fine, taking pictures crash and shuts down my app. Strange thing is, that I used same code a while ago in another app(in February I think) and I could take pctures with camera. Now, with newest SDK I can't use camera to take pictures in both apps(older and new). Please fix it asap. Thank you Edit: My app is not crashing anymore(SDK 5.3.1GA), but I have another problem - when camera window closes, app's main window moves up for few pixels and Notification bar hides(I have no code implemented to hide notification bar). On another app, everything is working fine(without moving). Can you help me with this? Thank you
Why does this keep getting moved back? It has 47 watchers so obviously it's important and effecting a lot a people.
This crash is consistently happening on various models, but specially on the Galaxy S6 family and it happens only if the flash is enabled. Ti.Media.setCameraFlashMode(Ti.Media.CAMERA_FLASH_ON);
+1
[~max87] Based on your updated comments, could you provide your logs from the crash? Preferably from the
adb logcat
.Hi Ashraf, my app is not crashing anymore, so I don't have any logs. I tried to update SDK to 6.0beta and update nodeJS, but I had to revert, so I'm currently on 5.3.1GA and nodeJS 0.12.7
We get consistent crashes on the Nexus 5X. One, sometimes two photos is all we can take before the app crashes. This looks to be the relevant portion of the logs. Nexus 5X, Android 6.0.1, Kernel v 3.10.73gf215204, Ti SDK 5.2.2.GA (though the crash has existed long before that SDK version)
We seem to have this bug too. We get a lot of complaints from our users where the app keeps crashing after returning from camera. Is there any progress towards this issue?
I'm having issues with my app too respect the camera. In some devices the application crashes if there is more than 2 images. It could crash. The images are about 6Mb and 10 Mb. And some times the image is not rendered in the imageview widget. The devices that presents the failure are Huawei P8, Motorola G and some others. ImageAsResized function presents some failures and crashes too in some devices so im using Ti.imagefactory to resize images so i can send them over 3G network to avoid this memory issue. System Vars: Operating System Name = Mac OS X Version = 10.11.6 Architecture = 64bit # CPUs = 4 Memory = 8589934592 Node.js Node.js Version = 4.6.0 npm Version = 2.15.9 Titanium CLI CLI Version = 5.0.10 Titanium SDK SDK Version = 5.4.1.v20160814221757 SDK Path = /Users/myuser/Library/Application Support/Titanium/mobilesdk/osx/5.4.1.v20160814221757 Target Platform = android if (Ti.Media.hasCameraPermissions()) { Titanium.Media.showCamera({ success : function(event) { // called when media returned from the camera Ti.API.debug('Our type was: ' + event.mediaType); Ti.Media.hideCamera(); if (event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) { LOG.info('SUCCESS: ' + JSON.stringify(event)); APP.showNotification('info', 'La imagen se ha capturado satisfactoriamente', $.visitFormWindow); //CRASH ON THIS. $.cameraPictureView.image = event.media; } else { alert('Error no se obtuvo la imagen satisfactoriamente'); } }, cancel : function() { // called when user cancels taking a picture }, error : function(error) { // called when there's an error var a = Titanium.UI.createAlertDialog({ title : 'Camera' }); if (error.code == Titanium.Media.NO_CAMERA) { a.setMessage('Error abriendo camara.'); } else { a.setMessage('Error inesperado: ' + error.code); } a.show(); }, saveToPhotoGallery : true });
We will take another look at this. Attempting to reproduce with current stack.
All power to you [~emerriman] but as this appears to be the JIRA that Appcelerator not only forgets but simply ignores and denies - I will not be holding my breath. Prove me wrong. Please.
We also keep experiencing a lot of crashes on production apps related to this bug. Astonishing to see that this has been open since 2012 with no solution at all.
Something that I found during testing: Device: HTC A9 (6.0.1) SDK: Ti 6.0.1.GA / 6.1.0 (nightly) * Starting the camera with the provided code crashed the app in the background while the camera view is open (launchCameraActivity, MediaModule.java) * Crashlog:
* using an *overlay* to run *launchNativeCamera* from MediaModule.java does *not crash* Looking up the "camera intent crash" situation you'll find a lot like this: http://stackoverflow.com/a/26708283/5193915 {quote}Launching camera requires a lot of memory. So on devices with low memory android system closes the Activities running in background{quote} The solution in this answer is to save the URL in the destroy() event and restore it later on. But then the app has to be restarted inside that activity/screen too. Not sure if that helps to find the cause or a solution but at least the _overlay_ version is not crashing for me. So I can create an empty overlay with a
take picture
button and can use it without a crashThanks [~michael] - This might help, but our problem right now is that no matter what we try we can't seem to reproduce. Lokesh will report on status so far. [~lchoudhary] Could you try launching some apps for additional memory pressure and see what happens?
Tried to check if I can make camera crash with the available devices & the current 6.0.1.GA SDK but, could not. I used the code in the description to test. If there is any other sample code to reproduce this I can check with please add it to this ticket so that we could test with it. Checked it with: 1. MotoG - Android 4.4.4 2. Samsung Galaxy S5 - Android 4.4.4 3. Nexus 5 - Android 5.1.1 4. Nexus 6 - Android 6.0.1 5. Nexus 6P - Android 7.1.1 [~emerriman], I will try what you asked for comment accordingly.
We have experienced most problems on older Samsung devices.
As mentioned before, we see it on Asus ZenFone 2E, Android 5.0.1 and with the current Titanium SDK 6.0.1 GA. The section of the code we have is pretty straight forward: Titanium.Media.showCamera({ success:function(event) { layoutHub.commonPhotoSuccess(event, 0); }, cancel:function(cancel) { lg("Camera CANCELED - error message = " + cancel.error); }, error:function(err) { lg("Camera ERROR - error message = " + err.error); commonHub.alertDialog( langHub.commonOops, langHub.epicFail ); }, mediaTypes:[Ti.Media.MEDIA_TYPE_PHOTO] }); What I've noticed is that it happens when my application is initially installed and when I use the camera for the FIRST time. After my app restarts from the crash, I am then able to take a photo successfully with the above code and call my commonPhotoSuccess() function. I hope that helps.
Please try with a Nexus 5x. Our app crashes consistently on the first or second picture every time on this device. After the app crashes, the camera is not released -- no apps can access the camera at all at that point and doing so crashes whatever app you're attempting to use. Rebooting the phone is the only way to recover.
[~lchoudhary] My app consistently breaks if using the flash on a Moto E. There's a free Moto E on TestObject.com you could probably use. !https://www.dropbox.com/s/deypvck96gvkwma/Screen%20Shot%202017-01-24%20at%203.00.50%20PM.png?dl=1!
Could not reproduce. Code in success block was executed since alert dialogue returned "success" on picture save. Tested on S6 device and used the same code in the kitchen sink example on GitHub:
Did you test on a Nexus 5x or a Moto E? Those are two devices that we've identified in comments above as having frequent crashes. I have not had problem on Samsung S-series phones. Updated: I have gotten reports from the field today that users of ours with Google Pixel phones are having crashes that prevent the use of the camera within our app. So, there's another possible test device for you to check out.
[~acvauctions] Do you have access to any logs from those devices? It would be really helpful (y)
The Performance / Crittercism panel failed to record the crash on the customer's Pixel device. (I'm afraid Crittercism frequently fails to capture crashes, but that's a separate issue.) Using my Google Nexus 5x running Android 7.0 tethered locally to my machine, I get the following logs:
After updating the phone to Android 7.1.1, I get this crash log:
(they look to be pretty much the same at a cursory glance) We're using Ti.Media.showCamera() with an overlay and calling takePicture(). First picture was fine, second photo froze the device; I had to restart the phone to recover. Perhaps it's because Titanium is still using android.hardware.Camera (deprecated in API 21) instead of Camera2? There might be something about the new devices not compatible with the old class.
[~acvauctions] Does the same happen if you do not use the overlay and use the native camera? Just curious.
We're having random crashes too. We don't use an overlay. Currently a user with a Moto G3 is reporting the issue.
I have a 430kb log file in which the crash happens. Where can I send it?
[~topener] You should be able to click 'More' > 'Attach Files'. If not, you could use http://pastebin.com/
We're also experiencing those random crashes. We use the showCamera method normally without any overlays. Crittercism doesn't seem to produce any helpful information. Logcat only shows those E/mm-camera garbage but don't provide anything else before the app crashes. Already tried setting largeHeap to true but that had no effect whatsoever. We've managed to reproduce this bug constantly on a MotoG 2nd Generation but the same code with the exact same variables doesn't cause the camera to crash on a MotoG Turbo Edition (both running Android 6.0). This is a long-time bug that were always randomly reported by our use base.
Awkwardly, (like an old 386 running Windows XP), if you reboot the damn Android device, you can (for some time) use the camera normally (both for photos and videos)... (tested on MotoG2) idk if this behavior affects non-Titanium native Android apps using the camera but this is a very strange behavior to say the least. once it starts crashing the only way to make things work again is restarting the phone. simply uninstalling/reinstalling the app has no effect.
[~ygbr] That's due to not enough memory being available to use the camera. It sounds like too many apps are open in the background, using up lots of memory and the Moto G2 only has 1GB of RAM.
attached the crash log with a phone attached while it happened. hope this helps
@Gary It's not about memory! I'm 100% sure that in my last tests ONLY my app was open in foreground. I have also removed almost everything from the device and it is almost in factory state with only my app, Facebook and a few other apps to test integrations. Also this is a MotoG so there isn't a lot of crap running along the OS itself like in Samsung devices. Also I've run Android Monitor together with my app and definitively there was enough free memory left on the device, if it was a memory problem I'm pretty sure I would see OOM Errors on logcat. Also as I have mentioned above I have also tried to run with largeHeap and it didn't help. Also there are devices with only 512Mb of RAM that runs the app (same code with the same parameters) normally without the Camera related crashes.
It is absolutely not a memory thing. Nexus 5x is a flagship Google phone. I can clean boot, no apps running, start my app & take one photo and the phone crashes. As I stated above, the app crash leaves the camera in a locked state so that no other processes can access it. (Because the app has crashed, [release()](https://developer.android.com/reference/android/hardware/Camera.html#release()) is never called. Thus, the only way to release it is to reboot the phone.) This is a test device, with no apps other than what is provided stock when we bought the phone from Google plus our prod app version and test/development app version installed.
[~acvauctions] [~ygbr] I have compiled a test case with some fixes I've made to the SDK. Since I can't reproduce your issues on any of my devices could you run this test case and tell me if the problem persists? It appears there are varying issues posted under this ticket which is confusing. [TIMOB-12848.apk (testCase)](http://garymathews.com/TIMOB-12848.apk)
@Gary I have installed your APK on a MotoG (2nd generation) and after I took the first picture and tapped the check mark (to accept the picture) it crashed. After that I have reopened the app and it worked normally for many pictures I took.
[~ygbr] Are you able to reproduce the crash and paste the log?
That seems to work fine on my Nexus 5x (Android 7.0). I was able to take, retake, cancel, take, etc. a dozen or so pictures without any crashes. Our app uses an overlay. Any chance you could post an updated version of your test app that uses an overlay so I can be sure it also works correctly? I also tested on a couple of our other test devices that have not had camera crash issues like the 5x. * Galaxy S5 running Android 6.0.1 -- worked without crashing though the photo wouldn't show in the ImageView, logs said the bitmap was too large * a custom Android tablet (BAK USA) running Android running 4.4.2 -- worked without crashing and as expected
I never found any real logic in the crashes. Sometimes it happens, sometimes it doesn't. When it did it was easily reproducible and sometimes even needed a devices restart to get it to work again.
I have a user using a custom overlay on a SM-G920T running Android 6.0.1 who is experiencing crashes when using a custom overlay.
Sample Code:
Error:
http://paste.thezomg.com/20078/36994514/ He is reporting that without the custom overlay everything works fine.master: https://github.com/appcelerator/titanium_mobile/pull/8868
6_2_X: https://github.com/appcelerator/titanium_mobile/pull/9326
Environment: Node Version: 6.10.3 NPM Version: 3.10.10 Mac OS: 10.12.4 Appc CLI: 6.2.3 Appc CLI NPM: 4.2.9 Titanium SDK version: 6.2.0.v20170829115147 Appcelerator Studio, build: 4.9.1.201707200100 Xcode 8.3.2 Android OS 5.1.1, 7.1.2, 4.4.4, 6.0.1 Android phones: Galaxy S4, Pixel, HTC One X, Nexus, Nexus 5 I tried testing for the crash with the above phones and OS. I found no crashes while going through the sequence (and looping manually): Open Camera, Take Picture, Review Picture. I tried about 50 times, and no crashes occurred. I was not able to test with a Galaxy S6, as the device is not available in our lab.
Changes are seen in the following SDKs: 6.2.0.v20170829141855 7.0.0.v20170829141756
I still have this issue with 7.3.1.GA when using the normal camera (not the overlay) {noformat} 08-31 15:27:14.251 26035 26035 I TiAPI : --------------show camera---------------- 08-31 15:27:17.518 27370 27370 W HTCCamera: saveAndFinish() - contentUri = 'content://com.miga.moments.tifileprovider/filesystem/storage/emulated/0/Android/data/com.miga.moments/files/Pictures/moments/tia585926368.jpg' 08-31 15:27:17.529 2466 2491 I art : Explicit concurrent mark sweep GC freed 34329(1857KB) AllocSpace objects, 9(196KB) LOS objects, 9% free, 155MB/171MB, paused 2.341ms total 362.763ms 08-31 15:27:17.529 2466 2475 I art : WaitForGcToComplete blocked for 237.338ms for cause HeapTrim 08-31 15:27:17.533 2466 3616 I ActivityManager: Start proc 27513:com.miga.moments/u0a1046 for content provider com.miga.moments/org.appcelerator.titanium.io.TiFileProvider 08-31 15:27:17.534 2466 2625 V NetworkPolicy: updateRuleForRestrictBackgroundLocked(11046): isForeground=true, isBlacklisted=false, isWhitelisted=false, oldRule=0 (NONE), newRule=0 (NONE), newUidRules=0 (NONE), oldUidRules=0 (NONE) 08-31 15:27:17.534 2466 2625 V NetworkPolicy: updateRulesForNonMeteredNetworksLocked(11046), isIdle: false, mRestrictPower: false, mDeviceIdleMode: false, isForeground=true, isWhitelisted=false, oldRule=0 (NONE), newRule=0 (NONE), newUidRules=0 (NONE), oldUidRules=0 (NONE) 08-31 15:27:17.653 27513 27513 I TiApplication: (main) [0,0] checkpoint, app created. 08-31 15:27:17.757 27513 27513 I TiApplication: (main) [110,110] Titanium 7.3.1 (2018/08/29 00:19 undefined) 08-31 15:27:17.793 27370 27370 W HTCCamera: finish() 08-31 15:27:17.807 27370 27370 W HTCCamera: onPause() - start 08-31 15:27:17.809 27370 27370 W HTCCamera: onPreviewResourcesDestroyed() 08-31 15:27:17.811 27370 27370 D HTCCamera(BaseObjectProxy): [Event] Pausing : End 08-31 15:27:17.811 27370 27370 D Property: [HTCCamera.IsActivityPaused] false -> true 08-31 15:27:17.829 27370 27370 W HTCCamera: onPause() - mIsUIReady = false 08-31 15:27:17.830 27370 27370 W HTCCamera: onPause mIdle is false 08-31 15:27:17.844 27370 27370 D Property: [HTCCamera.TakingPictureState] Reviewing -> Preparing 08-31 15:27:17.845 27370 27370 W HTCCamera: onActionScreenClosed() - Activity is paused 08-31 15:27:17.845 27370 27370 W HTCCamera: OnPause - Freeze UI !!! 08-31 15:27:17.847 27370 27370 W HTCCamera: doOnPause() - start 08-31 15:27:17.847 27370 27370 W HTCCamera: OnPause - hide UI, set mMainLayout invisible 08-31 15:27:17.848 27370 27370 W HTCCamera: doOnPause() - end 08-31 15:27:17.849 27370 27370 W HTCCamera: onPause +++stopPreview() 08-31 15:27:17.851 27370 27370 W HTCCamera: onPause ---stopPreview() 08-31 15:27:17.851 27370 27390 W CameraThread: closeCamera() - Start 08-31 15:27:17.858 27370 27370 W HTCCamera: onPause() - end 08-31 15:27:17.867 27370 27390 W CameraDeviceManager: closeCamera() - Release camera - start 08-31 15:27:17.867 27370 27390 W CameraController: close(Main) 08-31 15:27:17.867 27370 27390 W CameraController: suspendCamera(Front) 08-31 15:27:17.868 27370 27390 W CameraController: suspendCamera(Front3D) 08-31 15:27:17.868 27370 27390 W CameraController: close() - Release camera [start] 08-31 15:27:17.994 2466 3902 W ActivityManager: Exception when starting activity com.miga.moments/org.appcelerator.titanium.TiActivity 08-31 15:27:17.994 2466 3902 W ActivityManager: android.os.DeadObjectException 08-31 15:27:17.994 2466 3902 W ActivityManager: at android.os.BinderProxy.transactNative(Native Method) 08-31 15:27:17.994 2466 3902 W ActivityManager: at android.os.BinderProxy.transact(Binder.java:623) 08-31 15:27:17.994 2466 3902 W ActivityManager: at android.app.ApplicationThreadProxy.scheduleLaunchActivity(ApplicationThreadNative.java:942) 08-31 15:27:17.994 2466 3902 W ActivityManager: at com.android.server.am.ActivityStackSupervisor.realStartActivityLocked(ActivityStackSupervisor.java:1309) 08-31 15:27:17.994 2466 3902 W ActivityManager: at com.android.server.am.ActivityStackSupervisor.startSpecificActivityLocked(ActivityStackSupervisor.java:1408) 08-31 15:27:17.994 2466 3902 W ActivityManager: at com.android.server.am.ActivityStack.resumeTopActivityInnerLocked(ActivityStack.java:2660) 08-31 15:27:17.994 2466 3902 W ActivityManager: at com.android.server.am.ActivityStack.resumeTopActivityUncheckedLocked(ActivityStack.java:2193) 08-31 15:27:17.994 2466 3902 W ActivityManager: at com.android.server.am.ActivityStackSupervisor.resumeFocusedStackTopActivityLocked(ActivityStackSupervisor.java:1832) 08-31 15:27:17.994 2466 3902 W ActivityManager: at com.android.server.am.ActivityStack.completePauseLocked(ActivityStack.java:1378) 08-31 15:27:17.994 2466 3902 W ActivityManager: at com.android.server.am.ActivityStack.activityPausedLocked(ActivityStack.java:1252) 08-31 15:27:17.994 2466 3902 W ActivityManager: at com.android.server.am.ActivityManagerService.activityPaused(ActivityManagerService.java:7207) 08-31 15:27:17.994 2466 3902 W ActivityManager: at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:602) 08-31 15:27:17.994 2466 3902 W ActivityManager: at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2925) 08-31 15:27:17.994 2466 3902 W ActivityManager: at android.os.Binder.execTransact(Binder.java:573) 08-31 15:27:17.995 2466 3902 D ActivityManager: cleanUpApplicationRecord -- 27513 08-31 15:27:18.008 2466 3902 I ActivityManager: Start proc 27536:com.miga.moments/u0a1046 for activity com.miga.moments/org.appcelerator.titanium.TiActivity 08-31 15:27:18.012 2466 4565 W ActivityManager: Spurious death for ProcessRecord{3331f36 27536:com.miga.moments/u0a1046}, curProc for 27513: null 08-31 15:27:18.021 27370 27390 W CameraController: close() - Release camera [end] 08-31 15:27:18.021 27370 27390 D Event : [CameraThread.CameraClosed] rasing 08-31 15:27:18.022 27370 27390 D Event : [CameraThread.CameraClosed] raised 08-31 15:27:18.022 27370 27390 W CameraThread: Release Camera 08-31 15:27:18.022 27370 27390 W CameraThread: closeCamera() - End 08-31 15:27:19.898 2466 2491 W WindowManager: App freeze timeout expired. 08-31 15:27:19.898 2466 2491 W WindowManager: Force clearing freeze: AppWindowToken{a1471ec token=Token{6a83c9f ActivityRecord{d64863e u0 com.miga.moments/org.appcelerator.titanium.TiActivity t4808}}} 08-31 15:27:19.899 2466 2485 D StatusBarManagerService: setSystemUiVisibility(0x8608) 08-31 15:27:19.899 2466 2485 D StatusBarManagerService: disable:userId=0 what=0x0 which=0x1 pkg=null 08-31 15:27:19.899 2466 2485 D StatusBarManagerService: hiding MENU key 08-31 15:27:19.900 2466 2491 I WindowManager: Screen frozen for +2s20ms due to Window{56a375b u0 Starting com.miga.moments} 08-31 15:27:20.310 27536 27536 I TiApplication: (main) [2097,2215] Titanium Javascript runtime: v8 08-31 15:27:20.345 27536 27536 W TiBaseActivity: (main) [35,2250] Runtime has been disposed or app has been killed. Finishing. {noformat} The log is from a HTC A9, Android 7, TiSDK 7.3.1.GA It starts when I open the camera (inside showCamera) and I take an image. You'll see that is saves the image to a temp location and shortly after that (search for
TiApplication
) it looks like it restarts the app "checkpoint, app created" ? Then it releases the camera view and it show this error: {noformat} Exception when starting activity com.miga.moments/org.appcelerator.titanium.TiActivity 08-31 15:27:17.994 2466 3902 W ActivityManager: android.os.DeadObjectException {noformat} then it will crash the whole app restarts the app (at the end of the log) Works fine when using an overlay