# Exiting app after take picture

**URL:** <https://forums.fusetools.com/t/exiting-app-after-take-picture/5369>\
**Category:** Bug Reports\
**Created:** [April 20, 2017, 6:17pm UTC](https://forums.fusetools.com/t/exiting-app-after-take-picture/5369 "2017-04-20T18:17:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wilton\_Augusto](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/wilton_augusto/32/336_2.png) [@Wilton\_Augusto](https://forums.fusetools.com/u/Wilton_Augusto)\
**Post date:** [April 20, 2017, 6:17pm UTC](https://forums.fusetools.com/t/exiting-app-after-take-picture/5369/1 "2017-04-20T18:17:51Z")

</div>

When I call the native camera, after accepting the picture taken, the application often exits to the previous openned app or to the android home screen. Sometimes it opens the app again, but is not the most common thing to happen.  
It does not trigger any errors.  
just exits the application.

It occours less in the moto x play with android 6.0  
but in cellphones with android 5.0 and 4.4 the most common thing is to exit the app after take the picture.

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [April 21, 2017, 8:25am UTC](https://forums.fusetools.com/t/exiting-app-after-take-picture/5369/2 "2017-04-21T08:25:53Z")

</div>

Hi Wilton,

with the information you’ve supplied it’s hard to tell anything. Could you try running the app preview with `fuse preview -tandroid` from Terminal (console) and see if anything is thrown there after you take the picture?

---

<div class="post-metadata">

**Author:** ![jesusmartinoza](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/jesusmartinoza/32/659_2.png) [@jesusmartinoza](https://forums.fusetools.com/u/jesusmartinoza)\
**Post date:** [April 21, 2017, 1:51pm UTC](https://forums.fusetools.com/t/exiting-app-after-take-picture/5369/3 "2017-04-21T13:51:34Z")

</div>

Hi Wilton, try changing the quality of the photo. Sometimes a big quality causes OOM exception.

@uldis Later I post a detailed log (:

---

<div class="post-metadata">

**Author:** ![jesusmartinoza](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/jesusmartinoza/32/659_2.png) [@jesusmartinoza](https://forums.fusetools.com/u/jesusmartinoza)\
**Post date:** [April 21, 2017, 4:29pm UTC](https://forums.fusetools.com/t/exiting-app-after-take-picture/5369/4 "2017-04-21T16:29:16Z")

</div>

- Device: Galaxy S5 (SM-G900M)
- Android version: 5.0
- Picture size: (16M) 5312x2988

```auto
W/ContextImpl( 6852): Failed to ensure directory: /storage/extSdCard/Android/data/mx.qmarketing.futuromexico/cache
I/art ( 6852): Background sticky concurrent mark sweep GC freed 4688(268KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 85MB/85MB, paused 579us total 275.888ms
I/art ( 6852): Background partial concurrent mark sweep GC freed 2647(99KB) AllocSpace objects, 1(64KB) LOS objects, 15% free, 85MB/101MB, paused 619us total 497.535ms
I/art ( 6852): Alloc sticky concurrent mark sweep GC freed 7(416B) AllocSpace objects, 0(0B) LOS objects, 8% free, 85MB/93MB, paused 638us total 5.285ms
I/art ( 6852): Alloc partial concurrent mark sweep GC freed 83(3KB) AllocSpace objects, 1(16KB) LOS objects, 15% free, 85MB/101MB, paused 624us total 31.157ms
I/art ( 6852): Alloc concurrent mark sweep GC freed 9(12KB) AllocSpace objects, 0(0B) LOS objects, 15% free, 85MB/101MB, paused 702us total 34.198ms
I/art ( 6852): Forcing collection of SoftReferences for 60MB allocation
I/art ( 6852): Alloc concurrent mark sweep GC freed 11(344B) AllocSpace objects, 0(0B) LOS objects, 15% free, 85MB/101MB, paused 627us total 48.621ms
E/art ( 6852): Throwing OutOfMemoryError "Failed to allocate a 63489036 byte allocation with 16777216 free bytes and 42MB until OOM"
W/System.err( 6852): java.lang.OutOfMemoryError: Failed to allocate a 63489036 byte allocation with 16777216 free bytes and 42MB until OOM
W/System.err( 6852): at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
W/System.err( 6852): at android.graphics.Bitmap.nativeCreate(Native Method)
W/System.err( 6852): at android.graphics.Bitmap.createBitmap(Bitmap.java:939)
W/System.err( 6852): at android.graphics.Bitmap.createBitmap(Bitmap.java:912)
W/System.err( 6852): at android.graphics.Bitmap.createBitmap(Bitmap.java:843)
W/System.err( 6852): at com.fusetools.camera.Image.rotateImage(Image.java:68)
W/System.err( 6852): at com.fusetools.camera.Image.correctOrientationFromExif(Image.java:96)
W/System.err( 6852): at com.foreign.Fuse.Camera.TakePictureCallback.HandleIntent354(TakePictureCallback.java:38)
W/System.err( 6852): at com.Bindings.ExternedBlockHost.HandleIntent354(ExternedBlockHost.java:1656)
W/System.err( 6852): at com.Bindings.ExternedBlockHost.callUno_Android_ActivityUtils_OnReceived68(Native Method)
W/System.err( 6852): at com.foreign.Android.ActivityUtils$1.onResult(ActivityUtils.java:39)
W/System.err( 6852): at com.fuse.Activity._onActivityResult(Activity.java:54)
W/System.err( 6852): at com.fuse.App.onActivityResult(App.java:198)
W/System.err( 6852): at mx.qmarketing.futuromexico.MainActivity.onActivityResult(MainActivity.java:76)
W/System.err( 6852): at android.app.Activity.dispatchActivityResult(Activity.java:6475)
W/System.err( 6852): at android.app.ActivityThread.deliverResults(ActivityThread.java:3970)
W/System.err( 6852): at android.app.ActivityThread.handleSendResult(ActivityThread.java:4017)
W/System.err( 6852): at android.app.ActivityThread.access$1400(ActivityThread.java:172)
W/System.err( 6852): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1471)
W/System.err( 6852): at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err( 6852): at android.os.Looper.loop(Looper.java:145)
W/System.err( 6852): at android.app.ActivityThread.main(ActivityThread.java:5832)
W/System.err( 6852): at java.lang.reflect.Method.invoke(Native Method)
W/System.err( 6852): at java.lang.reflect.Method.invoke(Method.java:372)
W/System.err( 6852): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
W/System.err( 6852): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
D/MainActivity( 6852): Uno.Exception: java.lang.OutOfMemoryError: Failed to allocate a 63489036 byte allocation with 16777216 free bytes and 42MB until OOM
D/MainActivity( 6852): at Android.Base.JNI.TryGetException(Android.Base.Primitives.JNIEnvPtr,[string])
D/MainActivity( 6852): at Android.Base.JNI.CheckException(Android.Base.Primitives.JNIEnvPtr,[string])
D/MainActivity( 6852): at Android.Base.JNI.CheckException(Android.Base.Primitives.JNIEnvPtr)
D/MainActivity( 6852): at Fuse.Camera.TakePictureCallback.OnActivityResult(int,Java.Object,object)
D/MainActivity( 6852): at Android.ActivityUtils.OnReceived(int,int,Java.Object)
W/System.err( 6852): java.lang.RuntimeException: Uno.Exception: java.lang.OutOfMemoryError: Failed to allocate a 63489036 byte allocation with 16777216 free bytes and 42MB until OOM
W/System.err( 6852): at Android.Base.JNI.TryGetException(Android.Base.Primitives.JNIEnvPtr,[string])
W/System.err( 6852): at Android.Base.JNI.CheckException(Android.Base.Primitives.JNIEnvPtr,[string])
W/System.err( 6852): at Android.Base.JNI.CheckException(Android.Base.Primitives.JNIEnvPtr)
W/System.err( 6852): at Fuse.Camera.TakePictureCallback.OnActivityResult(int,Java.Object,object)
W/System.err( 6852): at Android.ActivityUtils.OnReceived(int,int,Java.Object)
W/System.err( 6852): at com.Bindings.ExternedBlockHost.callUno_Android_ActivityUtils_OnReceived68(Native Method)
W/System.err( 6852): at com.foreign.Android.ActivityUtils$1.onResult(ActivityUtils.java:39)
W/System.err( 6852): at com.fuse.Activity._onActivityResult(Activity.java:54)
W/System.err( 6852): at com.fuse.App.onActivityResult(App.java:198)
W/System.err( 6852): at mx.qmarketing.futuromexico.MainActivity.onActivityResult(MainActivity.java:76)
W/System.err( 6852): at android.app.Activity.dispatchActivityResult(Activity.java:6475)
W/System.err( 6852): at android.app.ActivityThread.deliverResults(ActivityThread.java:3970)
W/System.err( 6852): at android.app.ActivityThread.handleSendResult(ActivityThread.java:4017)
W/System.err( 6852): at android.app.ActivityThread.access$1400(ActivityThread.java:172)
W/System.err( 6852): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1471)
W/System.err( 6852): at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err( 6852): at android.os.Looper.loop(Looper.java:145)
W/System.err( 6852): at android.app.ActivityThread.main(ActivityThread.java:5832)
W/System.err( 6852): at java.lang.reflect.Method.invoke(Native Method)
W/System.err( 6852): at java.lang.reflect.Method.invoke(Method.java:372)
W/System.err( 6852): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
W/System.err( 6852): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
F/libc ( 6852): Fatal signal 6 (SIGABRT), code -6 in tid 6852 (ng.futuromexico)

```

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [April 21, 2017, 4:41pm UTC](https://forums.fusetools.com/t/exiting-app-after-take-picture/5369/5 "2017-04-21T16:41:20Z")

</div>

Yeah, that’s certainly far too large, based on what I’ve seen before.

My personal experience tells that you’re generally safe when staying under 3000 pixels for both dimensions. That should be good enough for most applications.

---

<div class="post-metadata">

**Author:** ![jesusmartinoza](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/jesusmartinoza/32/659_2.png) [@jesusmartinoza](https://forums.fusetools.com/u/jesusmartinoza)\
**Post date:** [April 21, 2017, 4:47pm UTC](https://forums.fusetools.com/t/exiting-app-after-take-picture/5369/6 "2017-04-21T16:47:50Z")

</div>

Agree, in fact I’m using `Camera.takePicture(1080, 1080)` to reduce the size. The problem is that `Picture size: (16M) 5312x2988` is the user-level camera settings.

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [April 21, 2017, 5:00pm UTC](https://forums.fusetools.com/t/exiting-app-after-take-picture/5369/7 "2017-04-21T17:00:15Z")

</div>

I found a previously raised ticket for this and linked it to this post. The priority on that is probably low, but when any improvements are made this thread will be notified.

---

<div class="post-metadata">

**Author:** ![Wilton\_Augusto](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/wilton_augusto/32/336_2.png) [@Wilton\_Augusto](https://forums.fusetools.com/u/Wilton_Augusto)\
**Post date:** [April 26, 2017, 12:57pm UTC](https://forums.fusetools.com/t/exiting-app-after-take-picture/5369/8 "2017-04-26T12:57:56Z")

</div>

Thanks for you replys.  
I will run some tests and see if I get any new information. For now I only have access to the 6.0 phone. When I get the other devices again I will check the console log.
