# App crashing on build but not on Preview

**URL:** <https://forums.fusetools.com/t/app-crashing-on-build-but-not-on-preview/2726>\
**Category:** Bug Reports\
**Created:** [November 20, 2017, 4:18pm UTC](https://forums.fusetools.com/t/app-crashing-on-build-but-not-on-preview/2726 "2017-11-20T16:18:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juani\_Serra](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/juani_serra/32/463_2.png) [@Juani\_Serra](https://forums.fusetools.com/u/Juani_Serra)\
**Post date:** [November 20, 2017, 4:18pm UTC](https://forums.fusetools.com/t/app-crashing-on-build-but-not-on-preview/2726/1 "2017-11-20T16:18:18Z")

</div>

The strangest thing happens: My app works flawlessly in an Android device when using the Preview, but when I build my app and make a certain action in the app, it crashes.

Here’s the log:

```auto
Installing APK on 1 device(s)

Launching activity 'voyagercheckin'

Running logcat on 'G000KU06650306DP'
I/art ( 4526): Late-enabling -Xcheck:jni
I/ActivityManager( 520): Start proc 4526:com.apps.voyagercheckin/u0a20 for activity com.apps.voyagercheckin/.voyagercheckin
D/ActivityManager( 4526): default service binder = android.os.BinderProxy@279d3487
D/ActivityManager( 4526): default service = android.app.ActivityManagerProxy@2b5aafb4
D/VendorDisplayManagerGlobalCallback( 4526): callGetInstance: nil
I/ContextImpl( 4526): com.amazon.client.metrics.api registered service at i = 70
D/ProfileManager( 4526): Create ProfileManager instance
D/voyagercheckin( 4526): SDK: 22
W/linker ( 4526): libgnustl_shared.so: unused DT entry: type 0x6ffffffe arg 0x47d58
W/linker ( 4526): libgnustl_shared.so: unused DT entry: type 0x6fffffff arg 0x2
W/linker ( 4526): libV8Simple.so: unused DT entry: type 0x6ffffffe arg 0x2e070
W/linker ( 4526): libV8Simple.so: unused DT entry: type 0x6fffffff arg 0x3
W/linker ( 4526): libvoyagercheckin.so: unused DT entry: type 0x6ffffffe arg 0x22deac
W/linker ( 4526): libvoyagercheckin.so: unused DT entry: type 0x6fffffff arg 0x2
I/FrameworkJumpTable( 4526): Successfully loaded all classes
I/FrameworkJumpTable( 4526): Successfully loaded all methods
I/FrameworkJumpTable( 4526): Successfully loaded all fields
I/HAL ( 4526): loaded HAL id=gralloc path=/system/lib/hw/gralloc.mt8163.mali.so hmi=0xf7c7ff60 handle=0xeb9b1544
D/mali_winsys( 4526): new_window_surface returns 0x3000

D/OpenGLRenderer( 4526): Use EGL_SWAP_BEHAVIOR_PRESERVED: false
I/HAL ( 4526): loaded HAL id=gralloc path=/system/lib/hw/gralloc.mt8163.mali.so hmi=0x12e8a740 handle=0xeb9b1544
I/HAL ( 4526): loaded HAL id=gralloc path=/system/lib/hw/gralloc.mt8163.mali.so hmi=0x0 handle=0xeb9b1544
I/[MALI][Gralloc]( 4526): [+]r_hnd:0xf8088cd0, fd:32, ion_hnd(0x1), req_format(0x1), int_fmt(0x1) byte_stride(3328), flags(0x4), usage(0x100), size(3833856), alloc_size(3833856) 832(832)X1152(1152) pid(4526) sec (0)
D/Atlas ( 4526): Validating map...

I/OpenGLRenderer( 4526): Initialized EGL, version 1.4
D/OpenGLRenderer( 4526): Enabling debug mode 0
D/mali_winsys( 4526): new_window_surface returns 0x3000

D/mali_winsys( 4526): new_window_surface returns 0x3000
I/HAL ( 4526): loaded HAL id=gralloc path=/system/lib/hw/gralloc.mt8163.mali.so hmi=0x0 handle=0xeb9b1544
I/[MALI][Gralloc]( 4526): [+]r_hnd:0xf82aab08, fd:39, ion_hnd(0x2), req_format(0x1), int_fmt(0x1) byte_stride(3200), flags(0x4), usage(0xb00), size(4096000), alloc_size(4096000) 800(800)X1280(1280) pid(4526) sec (0)
I/HAL ( 4526): loaded HAL id=gralloc path=/system/lib/hw/gralloc.mt8163.mali.so hmi=0x0 handle=0xeb9b1544
I/HAL ( 4526): loaded HAL id=gralloc path=/system/lib/hw/gralloc.mt8163.mali.so hmi=0x0 handle=0xeb9b1544

I/HAL ( 4526): loaded HAL id=gralloc path=/system/lib/hw/gralloc.mt8163.mali.so hmi=0x0 handle=0xeb9b1544
I/[MALI][Gralloc]( 4526): [+]r_hnd:0xf82fb440, fd:41, ion_hnd(0x3), req_format(0x1), int_fmt(0x1) byte_stride(3200), flags(0x4), usage(0xb00), size(4096000), alloc_size(4096000) 800(800)X1280(1280) pid(4526) sec (0)
I/HAL ( 4526): loaded HAL id=gralloc path=/system/lib/hw/gralloc.mt8163.mali.so hmi=0x0 handle=0xeb9b1544
I/[MALI][Gralloc]( 4526): [+]r_hnd:0xf839f930, fd:43, ion_hnd(0x4), req_format(0x1), int_fmt(0x1) byte_stride(3200), flags(0x4), usage(0xb00), size(4096000), alloc_size(4096000) 800(800)X1280(1280) pid(4526) sec (0)
I/HAL ( 4526): loaded HAL id=gralloc path=/system/lib/hw/gralloc.mt8163.mali.so hmi=0x0 handle=0xeb9b1544
I/[MALI][Gralloc]( 4526): [+]r_hnd:0xf8294b60, fd:42, ion_hnd(0x5), req_format(0x1), int_fmt(0x1) byte_stride(3200), flags(0x4), usage(0xb00), size(4096000), alloc_size(4096000) 800(800)X1280(1280) pid(4526) sec (0)
I/HAL ( 4526): loaded HAL id=gralloc path=/system/lib/hw/gralloc.mt8163.mali.so hmi=0x0 handle=0xeb9b1544
I/[MALI][Gralloc]( 4526): [+]r_hnd:0xf8297448, fd:44, ion_hnd(0x6), req_format(0x1), int_fmt(0x1) byte_stride(3200), flags(0x4), usage(0xb00), size(4096000), alloc_size(4096000) 800(800)X1280(1280) pid(4526) sec (0)

I/HAL ( 4526): loaded HAL id=gralloc path=/system/lib/hw/gralloc.mt8163.mali.so hmi=0x0 handle=0xeb9b1544
I/[MALI][Gralloc]( 4526): [+]r_hnd:0xf8294440, fd:45, ion_hnd(0x7), req_format(0x1), int_fmt(0x1) byte_stride(3200), flags(0x4), usage(0xb00), size(4096000), alloc_size(4096000) 800(800)X1280(1280) pid(4526) sec (0)

W/ResourceType( 4526): Attempt to retrieve bag 0x0103003e which is invalid or in a cycle.

D/CRLSetManager( 4526): getInstance binder: android.os.BinderProxy@6736861

D/voyager-checkin( 4526): Entro: Ghost%20Contact

D/CRLSetManager( 4526): getInstance binder: android.os.BinderProxy@6736861

D/voyager-checkin( 4526): Entro: Ghost%20Contact

E/voyager-checkin( 4526): Uno.NullReferenceException: Object reference was null
D/voyagercheckin( 4526): Uno.NullReferenceException: Object reference was null
D/AndroidRuntime( 4526): Shutting down VM
E/AndroidRuntime( 4526): FATAL EXCEPTION: main
E/AndroidRuntime( 4526): Process: com.apps.voyagercheckin, PID: 4526
E/AndroidRuntime( 4526): java.lang.RuntimeException: Uno.NullReferenceException: Object reference was null
E/AndroidRuntime( 4526): at com.Bindings.ExternedBlockHost.callUno_Uno_Platform_AndroidDisplay_OnFrameCallback55(Native Method)
E/AndroidRuntime( 4526): at com.foreign.Uno.Platform.AndroidDisplay$1.doFrame(AndroidDisplay.java:55)
E/AndroidRuntime( 4526): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:779)
E/AndroidRuntime( 4526): at android.view.Choreographer.doCallbacks(Choreographer.java:592)
E/AndroidRuntime( 4526): at android.view.Choreographer.doFrame(Choreographer.java:559)
E/AndroidRuntime( 4526): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:767)
E/AndroidRuntime( 4526): at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime( 4526): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime( 4526): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 4526): at android.app.ActivityThread.main(ActivityThread.java:5484)
E/AndroidRuntime( 4526): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 4526): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 4526): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:984)
E/AndroidRuntime( 4526): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
I/AndroidRuntime( 4526): To Report FATAL to activityManagerService

I/AndroidRuntime( 4526): Finished reporting FATAL to activityManagerService
I/Process ( 4526): Sending signal. PID: 4526 SIG: 9

I/Kernel ( 4526): [350849.666556] <1> (1)[4670:AsyncTask #2][name:ion&][ION]warning: release handle @ client destroy: handle=ffffffc053f90200, buf=ffffffc002398300, ref=4, size=4096000, kmap=0
I/Kernel ( 4526): [350849.666585] <1> (1)[4670:AsyncTask #2][name:ion&][ION]warning: release handle @ client destroy: handle=ffffffc0528ea880, buf=ffffffc002398400, ref=2, size=4096000, kmap=0
I/Kernel ( 4526): [350849.666601] <1> (1)[4670:AsyncTask #2][name:ion&][ION]warning: release handle @ client destroy: handle=ffffffc051fb0680, buf=ffffffc00d23c500, ref=2, size=4096000, kmap=0
I/Kernel ( 4526): [350849.666616] <1> (1)[4670:AsyncTask #2][name:ion&][ION]warning: release handle @ client destroy: handle=ffffffc059214200, buf=ffffffc00d252e00, ref=2, size=4096000, kmap=0
I/Kernel ( 4526): [350849.666631] <1> (1)[4670:AsyncTask #2][name:ion&][ION]warning: release handle @ client destroy: handle=ffffffc00d4fe280, buf=ffffffc025a37d00, ref=4, size=4096000, kmap=0
I/Kernel ( 4526): [350849.666646] <1> (1)[4670:AsyncTask #2][name:ion&][ION]warning: release handle @ client destroy: handle=ffffffc007de1c80, buf=ffffffc026656400, ref=2, size=4096000, kmap=0
I/Kernel ( 4526): [350849.666662] <1> (1)[4670:AsyncTask #2][name:ion&][ION]warning: release handle @ client destroy: handle=ffffffc01cda7b00, buf=ffffffc051762900, ref=6, size=3833856, kmap=0
I/ActivityManager( 520): Process com.apps.voyagercheckin (pid 4526) has died
D/ActivityManager( 520): cleanUpApplicationRecord -- 4526
W/Eve ( 520): MEMORY_CRITICAL: Memory available=597508KB free=136236KB LMK kills [4526,1]

Process com.apps.voyagercheckin terminated.

```

Anyone with a clue on what could be happening? Thanks!

---

<div class="post-metadata">

**Author:** ![petterroea](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/petterroea/32/438_2.png) [@petterroea](https://forums.fusetools.com/u/petterroea)\
**Post date:** [November 20, 2017, 6:34pm UTC](https://forums.fusetools.com/t/app-crashing-on-build-but-not-on-preview/2726/2 "2017-11-20T18:34:13Z")

</div>

Hello

The stack trace alone doesn’t really give any hints on what happened unless we have code to look at. Are you able to provide a minimal app reproducing the exception above, for debugging?

Thanks!

---

<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:** [November 22, 2017, 11:52am UTC](https://forums.fusetools.com/t/app-crashing-on-build-but-not-on-preview/2726/3 "2017-11-22T11:52:01Z")

</div>

As we found, this was caused by a data-binding being lost when used inside of a UX expression.

Expecting @Juani to come back with a reproduction shortly, and we’ll log a ticket about that.

---

<div class="post-metadata">

**Author:** ![Juani\_Serra](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/juani_serra/32/463_2.png) [@Juani\_Serra](https://forums.fusetools.com/u/Juani_Serra)\
**Post date:** [November 22, 2017, 3:54pm UTC](https://forums.fusetools.com/t/app-crashing-on-build-but-not-on-preview/2726/4 "2017-11-22T15:54:28Z")

</div>

Ok, this is the bug reproduction. I commented the line that is crashing the app.

```auto
<App Background="Black">
  <JavaScript>
    var Observable = require("FuseJS/Observable");
    var dynamicText = Observable('');

    function changeText() {
      dynamicText.value = "John Doe";
    }

    module.exports = {
      dynamicText: dynamicText,
      changeText: changeText
    }
  </JavaScript>
    <StackPanel Alignment="VerticalCenter" ItemSpacing="20">
      <Rectangle Alignment="Center" Padding="10" Color="Red">
        <Text Color="#fff" Value="Change Text" />
        <Clicked>
            <Callback Handler="{changeText}"/>
        </Clicked>
      </Rectangle>
      <myTextPanel textName="{dynamicText}" />
    </StackPanel>

    <Panel ux:Class="myTextPanel">
      <string ux:Property="textName" />
      <!--
        This crashes on build but it doesn't crashes on Preview:

        <Text Value="HI {= toUpper({ReadProperty textName})}!" TextAlignment="Center" Alignment="VerticalCenter" />
      -->
      <!--
        This doesn't crashes on build or Preview:
      -->
      <Text Value="HI {ReadProperty textName}!" TextAlignment="Center" Alignment="VerticalCenter" />
    </Panel>
</App>

```

---

<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:** [November 23, 2017, 10:09am UTC](https://forums.fusetools.com/t/app-crashing-on-build-but-not-on-preview/2726/5 "2017-11-23T10:09:17Z")

</div>

Thanks for an excellent reproduction! I’ve now logged an internal ticket about this and someone will take a look at it shortly.

We’ll notify here when there’s some progress.

---

<div class="post-metadata">

**Author:** ![kusma](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/kusma/32/595_2.png) [@kusma](https://forums.fusetools.com/u/kusma)\
**Post date:** [February 2, 2018, 4:08pm UTC](https://forums.fusetools.com/t/app-crashing-on-build-but-not-on-preview/2726/6 "2018-02-02T16:08:13Z")

</div>

This one was fixed a while back.
