Aliendalvik not starting after update to 4.5.0.16

I’ve done the update to the latest version, and as for some others, the process took a while, in my case over an hour and a half. So I did what was suggested, basically force restarted the device. At first glance everything looked to be working nicely, but then I noticed that there are no Android applications present. Running systemctl status aliendalvik returns the following:

[defaultuser@XperiaXA2 ~]$ systemctl status aliendalvik
● aliendalvik.service - Alien Dalvik
Loaded: loaded (/usr/lib/systemd/system/aliendalvik.service; enabled; vendor preset: enabled)
Drop-In: /usr/lib/systemd/system/aliendalvik.service.d
└─01-prevent-start.conf
Active: activating (start) since Fri 2023-02-03 19:30:33 CET; 1min 6s ago
Process: 23814 ExecStopPost=/usr/libexec/appsupport/stop-aliendalvik.sh (code=exited, status=0/SUCCESS)
Process: 23776 ExecStartPost=/usr/libexec/appsupport/alien-post-startup.sh (code=exited, status=20)
Main PID: 24096 (start-aliendalv)
Memory: 500.0K
CGroup: /system.slice/aliendalvik.service
├─24096 /bin/sh /usr/libexec/appsupport/start-aliendalvik.sh
├─24134 /bin/sh /usr/libexec/appsupport/start-aliendalvik.sh
└─25324 sleep 1

Feb 03 19:30:59 XperiaXA2 start-aliendalvik.sh[24096]: lxc-start: aliendalvik: confile.c: get_config_unsupported_key: 158 Invalid argument - Unsupported config key “lxc.seccomp”
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

Sifting through journalctl -b I see quite a few error related to aliendalivk:

Feb 03 19:31:28 XperiaXA2 invoker[24570]: [gbinder] WARNING: Error -2147483647 adding name “alien.NativeCall”
Feb 03 19:31:28 XperiaXA2 invoker[24570]: [gbinder] WARNING: Error -2147483647 adding name “alien.mediabrowsercontrol.bridge”
Feb 03 19:31:28 XperiaXA2 invoker[24570]: [gbinder] WARNING: Error -2147483647 adding name “wifinl80211”
Feb 03 19:31:28 XperiaXA2 invoker[24570]: [gbinder] WARNING: Error -2147483647 adding name “alien.mce”
Feb 03 19:31:28 XperiaXA2 invoker[24570]: [gbinder] WARNING: Error -2147483647 adding name “alien.NativeCall”
Feb 03 19:31:28 XperiaXA2 invoker[24570]: [gbinder] WARNING: Error -2147483647 adding name “alien.mediabrowsercontrol.bridge”
Feb 03 19:31:28 XperiaXA2 invoker[24570]: [gbinder] WARNING: Error -2147483647 adding name “alien.mce”
Feb 03 19:31:28 XperiaXA2 invoker[24570]: [gbinder] WARNING: Error -2147483647 adding name “alien.NativeCall”
Feb 03 19:31:28 XperiaXA2 invoker[24570]: [gbinder] WARNING: Error -2147483647 adding name “wifinl80211”

Or the following:

Feb 03 19:36:46 XperiaXA2 prepare-aliendalvik.sh[27400]: Failed to read ‘ANDROID_DATA_ROOT’ from environment variables for template ‘env:ANDROID_DATA_ROOT’
Feb 03 19:36:46 XperiaXA2 prepare-aliendalvik.sh[27400]: Failed to read ‘ANDROID_DATA_ROOT’ from environment variables for template ‘env:ANDROID_DATA_ROOT’
Feb 03 19:36:46 XperiaXA2 prepare-aliendalvik.sh[27400]: Failed to read ‘WAYLAND_SOCKET_PATH’ from environment variables for template ‘env:WAYLAND_SOCKET_PATH’
Feb 03 19:36:46 XperiaXA2 prepare-aliendalvik.sh[27400]: Failed to read ‘WAYLAND_SOCKET’ from environment variables for template ‘env:WAYLAND_SOCKET’
Feb 03 19:36:46 XperiaXA2 prepare-aliendalvik.sh[27400]: Failed to read ‘WAYLAND_SOCKET_PATH’ from environment variables for template ‘env:WAYLAND_SOCKET_PATH’
Feb 03 19:36:46 XperiaXA2 prepare-aliendalvik.sh[27400]: Failed to read ‘BINDER_DEV’ from environment variables for template ‘env:BINDER_DEV’
Feb 03 19:36:46 XperiaXA2 prepare-aliendalvik.sh[27400]: Failed to read ‘HWBINDER_DEV’ from environment variables for template ‘env:HWBINDER_DEV’
Feb 03 19:36:46 XperiaXA2 prepare-aliendalvik.sh[27400]: Failed to read ‘VNDBINDER_DEV’ from environment variables for template ‘env:VNDBINDER_DEV’
Feb 03 19:36:47 XperiaXA2 prepare-aliendalvik.sh[27400]: Failed to read ‘persist.multisim.config’ from properties for template ‘prop:persist.multisim.config’
Feb 03 19:36:47 XperiaXA2 prepare-aliendalvik.sh[27400]: Failed to read ‘persist.radio.multisim.config’ from properties for template ‘prop:persist.radio.multisim.config’
Feb 03 19:36:47 XperiaXA2 prepare-aliendalvik.sh[27400]: Failed to read ‘vendor.gralloc.disable_ubwc’ from properties for template ‘prop:vendor.gralloc.disable_ubwc’
Feb 03 19:36:47 XperiaXA2 prepare-aliendalvik.sh[27400]: Failed to read ‘ANDROID_DATA_ROOT’ from environment variables for template ‘env:ANDROID_DATA_ROOT’
Feb 03 19:36:47 XperiaXA2 prepare-aliendalvik.sh[27400]: Failed to read ‘WAYLAND_SOCKET_PATH’ from environment variables for template ‘env:WAYLAND_SOCKET_PATH’
Feb 03 19:36:47 XperiaXA2 prepare-aliendalvik.sh[27400]: Failed to read ‘WAYLAND_SOCKET’ from environment variables for template ‘env:WAYLAND_SOCKET’
Feb 03 19:36:47 XperiaXA2 prepare-aliendalvik.sh[27400]: Failed to read ‘WAYLAND_SOCKET_PATH’ from environment variables for template ‘env:WAYLAND_SOCKET_PATH’
Feb 03 19:36:47 XperiaXA2 prepare-aliendalvik.sh[27400]: Failed to read ‘WIDTH’ from environment variables for template ‘env:WIDTH’
Feb 03 19:36:47 XperiaXA2 prepare-aliendalvik.sh[27400]: Failed to read ‘HEIGHT’ from environment variables for template ‘env:HEIGHT’
Feb 03 19:36:47 XperiaXA2 prepare-aliendalvik.sh[27400]: Failed to read ‘DEPTH’ from environment variables for template ‘env:DEPTH’
Feb 03 19:36:47 XperiaXA2 prepare-aliendalvik.sh[27400]: Failed to read ‘DPI_X’ from environment variables for template ‘env:DPI_X’
Feb 03 19:36:47 XperiaXA2 prepare-aliendalvik.sh[27400]: Failed to read ‘DPI_Y’ from environment variables for template ‘env:DPI_Y’

And in the end:

Feb 03 19:36:47 XperiaXA2 start-aliendalvik.sh[27534]: lxc-start: aliendalvik: utils.c: lxc_can_use_pidfd: 1772 Kernel does not support pidfds
Feb 03 19:36:47 XperiaXA2 start-aliendalvik.sh[27534]: lxc-start: aliendalvik: confile.c: get_config_unsupported_key: 158 Invalid argument - Unsupported config key “lxc.seccomp”
Feb 03 19:36:47 XperiaXA2 start-aliendalvik.sh[27534]: lxc-attach: aliendalvik: attach.c: lxc_attach_run_command: 1808 No such file or directory - Failed to exec “/system/bin/getprop”
Feb 03 19:36:47 XperiaXA2 start-aliendalvik.sh[27534]: Supplementary services waiting for hwservicemanager…

I have no idea where to begin with those, but could it be that I was a bit too eager, and I interrupted the installation too early, even though it’s been running over 1.5h at that point?
Any ideas how to fix this other than a fresh installation?
Thanks!

One more thing to note, reinstalling from the Jolla app store did not help.
Is there any way to completely remove the Android App Support, like a purge of some sort?

devel-su rm -rf /home/.android
there is also one or two other thing you can do, but i forgot it and you should find them here somewhere

Any hint as to what I’d be looking for?

And rm -rf ~/android_storage

Here you can find the complete guide of removing the Android App Support.

2 Likes

Unfortunately, that did not help.
Ok, I guess reinstall is the only viable option left…
Which is a bummer, because only 4.4.0.72 is available for download… :expressionless:

I got the same problem on both of my devices. One is Xperia 10 II and the other an Xperia 10 III.

I tried to uninstall Android, reboot, install Android, reboot, and no difference. Same steps as you did I guess.

I have not yet read the system logs, but if I find anything useful I will post it here.

Until I got this sorted out it seems like my postmarketOS device with Waydroid will become my daily driver. :slight_smile:

Good to know I’m not the only one affected. But it seems that there are not that many of us.
Anyway, I did a factory reset yesterday, I thought it’d be faster than installing everything from scratch. I was wrong. It wasn’t. Factory reset downgraded my OS all the way to 4.2. I have no idea how or why. So had to update through 4.3-4.5, but luckily this time around all updates went fast and smoothly. All together took less than the initial upgrade to 4.5. Anyway, the Android subsystem is working correctly now.
One question though, and this is a bit off topic, but why is the installed applications list not included in the backups? I can understand that it would be quite difficult for the Android apps, even native apps coming from Openrepos or Chum, but not even the ones coming from the Jolla official app store? It can’t be that hard, can it?!

I “solved” this issue by downloading and re-flashing the 4.4 image and then update to 4.5 on both of my devices. The Xperia 10 III works like a charm, but the Xperia 10 II has no Internet connection in Android apps for some reason. I have not spent time trying to solve it since I won’t use that device anyway.

I assume restarting the device again doesn’t help either?

Unfortunately, it didn’t help.

I’m running this on XA2, and to be honest, I’d say it looks to be running slower than on 4.4, but, luckily, at least have internet connection.

I had this same problem. I tried restarting the phone, manually starting Android support through settings (had been set to automatic), and had even given it more than 24 hours. I was about to give up, I had more than 40 Android apps installed so I didn’t want to flash.

The solution turned out to be very simple:

systemctl restart aliendalvik

I waited about 30 seconds to a minute, ctrl+c in terminal

systemctl stop aliendalvik

I noticed some of my apps were showing up, but a lot were still missing so. Ctrl+c, then one more time

systemctl restart aliendalvik

All Android apps are there and the data has been retained. This is the only time a Sailfish update has ever given me an issue.

1 Like

We were bitten by this and after hours of debugging it turned out it was caused by a left-over Waydroid installation. If you have the waydroid package installed, just remove it and wait a few minutes (the AlienDalvik service will be restarted and then launch correctly after removing it).

If you are affected by this issue, you will see a bunch of log messages from the “Parcel” logger in the Android boot log (not journalctl, see below!) complaining about messages in an incompatible format being received.

Some lessons/tricks learned:

  • To get a boot log for the Android environment use:
    sudo -u appsupport-root lxc-attach --lxcpath="$(/usr/sbin/appsupport-config --lxc-path)" -n "$(/usr/sbin/appsupport-config --name)" -- /system/bin/bootstrap/linker64 /system/bin/logcat
    (Note the use of the custom …/bootstrap/linker64 to work around the main linker not being available yet from its APEX package)
  • To recreate the AlienDalvik LXC container without data loss use:
    sudo systemctl stop aliendalvik
    sudo umount /opt/alien/rootfs
    sudo lxc-destroy --lxcpath="$(/usr/sbin/appsupport-config --lxc-path)" -n "$(/usr/sbin/appsupport-config --name)"
    sudo systemctl restart aliendalvik-prepare.service
    
  • To reinstall all packages (effectively a dirty re-flash) use:
    sudo zypper in -f $(rpm -q -a --qf '%{NAME} ')
11 Likes

recreating the lxc container worked for me, and all the data is still there, this is great! Thanks a lot for saving me :blush:

1 Like

Nice!

but surely you didn’t reinstall all the packages (the last step in the previous post)?

sudo -u appsupport-root lxc-attach --lxcpath=/tmp/appsupport -n aliendalvik -- /system/bin/bootstrap/linker64 /system/bin/logcat lxc-attach: aliendalvik: attach.c: get_attach_context: 403 Failed to get init pid lxc-attach: aliendalvik: attach.c: lxc_attach: 1430 Failed to get attach context

You’re right, just the

devel-su bash
systemctl stop aliendalvik
umount /opt/alien/rootfs
lxc-destroy --lxcpath="$(/usr/sbin/appsupport-config --lxc-path)" -n "$(/usr/sbin/appsupport-config --name)"
systemctl restart aliendalvik-prepare.service
1 Like

lxc-destroy --lxcpath="$(/usr/sbin/appsupport-config --lxc-path)" -n "$(/usr/sbin/appsupport-config --name)"

lxc-destroy: aliendalvik: tools/lxc_destroy.c: main: 242 Container is not defined