Preview on android emulator

hi, i can’t preview my app on an android emulator. it outputs error Fatal E6101

Hi, can you provide some more info on your setup, such as:

  • Does the app work on real android devices?
  • Does this happen for all apps or just one in particular?
  • Which android emulator are you using and how is it configured (OS version etc…) ?

Please note that we in general don’t prioritize Android emulators when testing and developing Fuse, mainly because it’s very easy to test on real devices (as well as local preview for things that don’t rely on mobile platform features).

i don’t understand how to make my app work on real android device.
i want to use the emulator installed from fuse install command.

Documentation on how to use real devices is provided here: https://www.fusetools.com/docs/basics/preview-and-export

If you can provide the other info I requested we will still try to look into the issue. :slight_smile:

c:\sdc-live\build\Android\Preview\cache\ux11\MainView.g.uno(69,93,69,125): Warni
ng W0000: Absolute path C:/sdc-live/Assets/concert.mp4. In Uno, paths should be
relative to specifying file
(16.6s)

Generating code and data (2:6)
C:\Users\Emenike pc\AppData\Local\Fusetools\Fuse\App\app-0.28.1.8199\Packages\Un
oCore\0.39.1\targets\android\@(Project.Name)\app\build.gradle(1.1): FATAL E6101:
 Object reference not set to an instance of an object.
C:\Users\Emenike pc\AppData\Local\Fusetools\Fuse\App\app-0.28.1.8199\Packages\Un
oCore\0.39.1\targets\android\@(Project.Name)\app\build.gradle(1,2): FatalError E
6101: Object reference not set to an instance of an object.
Build ended
fuse: Failed to compile project

FATAL E6101: Object reference not set to an instance of an object.
fuse: Errors were encountered while building the project

This error occurs because the space in your username Emenike pc causes problems for the Android NDK. It is not related to the emulator in any way. :slight_smile:

We have added a fix for this in the latest Fuse release (still on the QA channel, here).
If you download this and then build with Gradle fuse build -tandroid -DGRADLE or fuse preview -tandroid -DGRADLE it should work.

how do i upgrade from fuse 0.28 to fuse 0.29?

You download the installer from here

i have downloaded it. do i need to uninstall fuse 0.28 first?

No, the installer will take care of that.

ok. thanks let me try

i got this error while trying to preview on my emulator

fuse preview -tandroid -DGRADLE
Fuse 0.29.0 (build 8396)
fuse: Could not find a fuse project to preview

Unfortunately, you have to specify the unoproj manually when using Gradle in preview. So the command would be

fuse preview <your unoproj> -tandroid -DGRADLE

i go this error following the above instruction

fuse preview myfuseapp -tandroid -DGRADLE
Fuse 0.29.0 (build 8396)
fuse: Could not find a fuse project to preview

It looks like you’re missing .unoproj at the end of myfuseapp. It should be myfuseapp.unoproj.

i corrected it and yet still error. is there something else i’m missing?

fuse preview myfuseapp.unoproj -tandroid -DGRADLE
Fuse 0.29.0 (build 8396)
Build started: FullCompile
Configuring (1.7s)
Compiling syntax tree (10.2s)
Generating code and data (16.9s)
C:\Users\Emenike pc\AppData\Local\Fusetools\Fuse\App\app-0.29.0.8396\Packages\UnoCore\0.40.2\targets\android@(Project.Name)\app\build.gradle(1.1): FATAL E6101: Object reference not set to an instance of an object.
C:\Users\Emenike pc\AppData\Local\Fusetools\Fuse\App\app-0.29.0.8396\Packages\UnoCore\0.40.2\targets\android@(Project.Name)\app\build.gradle(1,2): FatalError E6101: Object reference not set to an instance of an object.
Build ended
fuse: Failed to compile project

Finally got the app build. i had to install android 21. but i notice it is taking a long time to install apk on device.is it normal?
please help. i got this error

$ fuse preview myfuseapp.unoproj -tandroid -DGRADLE
Fuse 0.29.0 (build 8396)
Build started: FullCompile
Configuring (1.6s)
Compiling syntax tree (5.5s)
Generating code and data (25.1s)
Building Android app
2/2: myfuseapp.apk
(1:26)

Build completed in 119.01 seconds
Build ended
Installing APK on 1 device(s)
Launching activity 'myfuseapp'USER     PID   PPID  VSIZE  RSS     WCHAN    PC         NAME

root      1     0     704    372   ffffffff 00000000 S /init

root      2     0     0      0     ffffffff 00000000 S kthreadd

root      3     2     0      0     ffffffff 00000000 S ksoftirqd/0

root      5     2     0      0     ffffffff 00000000 S kworker/0:0H

root      7     2     0      0     ffffffff 00000000 S migration/0

root      8     2     0      0     ffffffff 00000000 S rcu_preempt

root      9     2     0      0     ffffffff 00000000 S rcu_bh

root      10    2     0      0     ffffffff 00000000 S rcu_sched

root      11    2     0      0     ffffffff 00000000 R migration/1

root      12    2     0      0     ffffffff 00000000 R ksoftirqd/1

root      14    2     0      0     ffffffff 00000000 S kworker/1:0H

root      15    2     0      0     ffffffff 00000000 R migration/2

root      16    2     0      0     ffffffff 00000000 R ksoftirqd/2

root      18    2     0      0     ffffffff 00000000 S kworker/2:0H

root      19    2     0      0     ffffffff 00000000 R migration/3

root      20    2     0      0     ffffffff 00000000 R ksoftirqd/3

root      22    2     0      0     ffffffff 00000000 S kworker/3:0H

root      23    2     0      0     ffffffff 00000000 S khelper

root      24    2     0      0     ffffffff 00000000 S suspend_sys_syn

root      25    2     0      0     ffffffff 00000000 S suspend

root      26    2     0      0     ffffffff 00000000 S writeback

root      27    2     0      0     ffffffff 00000000 S bioset

root      28    2     0      0     ffffffff 00000000 S kblockd

root      29    2     0      0     ffffffff 00000000 S khubd

root      43    2     0      0     ffffffff 00000000 S devfreq_wq

ERROR: Process has exited, so the requested information is not available.
root      45    2     0      0     ffffffff 00000000 S cfg80211

root      46    2     0      0     ffffffff 00000000 S iewq

root      47    2     0      0     ffffffff 00000000 D sprd_tb_thread

root      48    2     0      0     ffffffff 00000000 S kworker/2:1

root      49    2     0      0     ffffffff 00000000 S pm_print

root      50    2     0      0     ffffffff 00000000 S kswapd0

root      51    2     0      0     ffffffff 00000000 S ksmd

root      52    2     0      0     ffffffff 00000000 S fsnotify_mark

root      53    2     0      0     ffffffff 00000000 S crypto

root      69    2     0      0     ffffffff 00000000 S ion_heap_system

root      70    2     0      0     ffffffff 00000000 S ion_heap_carveo

root      71    2     0      0     ffffffff 00000000 S GIRQ WorkQueue

root      72    2     0      0     ffffffff 00000000 S f5376000.spi

root      73    2     0      0     ffffffff 00000000 S f5378000.spi

root      74    2     0      0     ffffffff 00000000 S kworker/1:1

root      75    2     0      0     ffffffff 00000000 S kworker/3:1

root      76    2     0      0     ffffffff 00000000 S f537a000.spi

root      77    2     0      0     ffffffff 00000000 S dwc_otg

root      78    2     0      0     ffffffff 00000000 S usb 2 pc wq

root      79    2     0      0     ffffffff 00000000 S usb detect wq

root      80    2     0      0     ffffffff 00000000 S ft5x0x_ts_resum

root      81    2     0      0     ffffffff 00000000 S focal-wait-queu

root      82    2     0      0     ffffffff 00000000 S headset_button

root      83    2     0      0     ffffffff 00000000 S headset_detect

root      84    2     0      0     ffffffff 00000000 S headset_sts_che

root      85    2     0      0     ffffffff 00000000 S headset_reg_dum

root      86    2     0      0     ffffffff 00000000 S adpgar_byp_sele

root      87    2     0      0     ffffffff 00000000 S sprdbat_monit

fuse: Android run failed

It’s normal that it takes a while to install the apk for the first time. But from then on you get instant reload.

It looks like there is another problem though. Can you please try to see if you get the same problem if you do fuse build instead of fuse preview?

fuse build myfuseapp.unoproj -tandroid -DGRADLE -r

Please also post detailed information about the model of your Android device, and which version of Android it’s running.

Model is Halo
Android version 4.42