Skip to content

Missing support for x86_64 Android Emulator #20

@andyl

Description

@andyl

x86_64 Android emulator support listed in support_matrix.md but no x86_64 OTP tarball is published

Environment

  • Host OS: Xubuntu 24.04 (x86_64)
  • mob: 0.6.14 (hex)
  • mob_dev: 0.5.10 (hex)
  • Android SDK: emulator 36.5.11.0, NDK 27.2.12479018
  • AVD: system-images;android-34;google_apis;x86_64

Summary

guides/support_matrix.md lists x86_64 (emulator) as a supported Android slice:

▎ | Android | arm64-v8a, x86_64 (emulator) | API 28 / Android 9 | Mob ships pre-built BEAM/erts for these slices only. … |

In practice, x86_64 isn't actually supported — there is no x86_64 OTP tarball published, no x86_64 path in the OTP downloader, and no android_x86_64 target in mix mob.release.otp. On an x86_64 Linux host (where ARM emulation is no longer possible — see "Why this matters" below), this combination is a hard wall: you cannot run a mob app in any emulator at all.

What's actually shipped

$ gh release view otp-d9045670 --repo GenericJam/mob --json assets --jq '.assets[].name'
otp-android-arm32-d9045670.tar.gz
otp-android-d9045670.tar.gz          # arm64-v8a only
otp-ios-device-d9045670.tar.gz
otp-ios-sim-d9045670.tar.gz

No otp-android-x86_64-*.tar.gz.

Code references

  • mob_dev/lib/mob_dev/otp_downloader.ex:19-24 — ensure_android/1 only switches on "armeabi-v7a"; every other ABI (including "x86_64") falls through to the arm64 tarball.
  • mob_dev/lib/mix/tasks/mob.release.otp.ex — @valid_targets is ["android_arm64", "android_arm32", "ios_sim", "ios_device", "all"]. No x86_64 target exists, so even building locally isn't a supported path.
  • mob_new's generated android/app/build.gradle defaults abiFilters to 'arm64-v8a', 'armeabi-v7a' — note armeabi-v7a is in the template but isn't in support_matrix.md's "floor" either, while x86_64 is missing despite being listed.

Reproduce

  1. On an x86_64 Linux host, mix mob.new myapp && cd myapp && mix mob.install
  2. Create and start an x86_64 AVD:
echo "no" | avdmanager create avd -n mob_test -k "system-images;android-34;google_apis;x86_64" -d "pixel_7"
emulator -avd mob_test -no-snapshot
  1. mix mob.deploy --native — APK installs, icon appears, launcher tap succeeds.
  2. App exits cleanly within ~ms of nativeStartBeam(). No logcat error, no erl_crash.dump. (Matches Incident Missed some folders in deps #1 in beam_crash.md.)
  3. mix mob.connect times out waiting for the node:
ando_android_emulator36x5x11x0@127.0.0.1 ...  ✗
✗ sdk_gphone64_x86_64: timed out waiting for any of [...]

Why this matters

On x86_64 Linux hosts, falling back to an arm64 AVD is no longer an option:

$ emulator -avd mob_test_arm64 -no-snapshot
FATAL | Avd's CPU Architecture 'arm64' is not supported by the QEMU2 emulator
on x86_64 host. System image must match the host architecture.

Modern Android Emulator (36.x) dropped arm64-on-x86_64 emulation. Combined with the missing x86_64 OTP, x86_64 Linux developers have no working emulator path — they're forced onto a physical arm64 device.

This is fine for some, but it makes mob unusable for any contributor without spare arm64 hardware.

Suggested fix

Publish an x86_64 OTP tarball alongside the existing two, and wire it through the toolchain:

  1. OTP source: add xcomp/erl-xcomp-x86_64-unknown-linux-android.conf (Erlang/OTP repo — same pattern as the existing arm64/arm32 confs). The macOS-host AR/RANLIB fix from common_fixes.md applies equally.
  2. MobDev.Release.OTP: add an :android_x86_64 target. Build OpenSSL for the same triple via mix mob.release.openssl.
  3. mix mob.release.otp: add "android_x86_64" to @valid_targets.
  4. MobDev.OtpDownloader:
    • Add @android_x86_64_name "otp-android-x86_64-#{@otp_hash}".
    • Extend ensure_android/1 and android_otp_dir/1 to handle "x86_64".
  5. mix mob.install: call ensure_android("x86_64") alongside the existing arm64 / arm32 calls.
  6. mob_new templates:
    • android/app/build.gradle: default abiFilters to 'arm64-v8a', 'x86_64' (drop armeabi-v7a since the support matrix doesn't promise it either, or document it as an opt-in).
    • android/app/src/main/jni/CMakeLists.txt: add an elseif(ANDROID_ABI STREQUAL "x86_64") branch alongside the existing arm32 one, selecting an OTP_RELEASE_X86_64 path.
    • build.gradle: read mob.otp_release_x86_64 from local.properties / MOB_ANDROID_OTP_RELEASE_X86_64 env.
  7. mix mob.install: write mob.otp_release_x86_64 into android/local.properties after download.
  8. Publish: upload otp-android-x86_64-d9045670.tar.gz to the otp-d9045670 release.

Workaround in the meantime

Either:

  • Develop against a physical arm64 phone over USB (works today).
  • Update guides/support_matrix.md to reflect reality — strike x86_64 (emulator) from the Android row, or move it to a "planned, not yet shipped" note — so users on x86_64 Linux hosts know up front that they need physical hardware. The current wording reads like a green-light when it's not, and the silent BEAM exit on x86_64 emulators is a particularly painful failure mode to diagnose (no logcat, no crash file).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions