Skip to content

MOB-404: mob.release builds native code from the current plugin set - #125

Merged
GenericJam merged 3 commits into
masterfrom
fix/MOB-404-release-native
Oct 6, 2026
Merged

GenericJam merged 3 commits into
masterfrom
fix/MOB-404-release-native

Conversation

@GenericJam

Copy link
Copy Markdown
Owner

Fixes MOB-404. See CHANGELOG [Unreleased]. Proof and review verdict to follow in comments.

GenericJam and others added 3 commits October 6, 2026 05:14
mix mob.release --android never rebuilt the native library; Gradle imported
the jniLibs/<abi>/lib<app>.so the last mix mob.deploy --native left, so a
release after adding a native plugin shipped a stale .so and crashed at
launch (Operator 1.0.0, mob_sensors: UnsatisfiedLinkError nativeRegister).

NativeBuild.build_android_native/2 is the pre-Gradle half of the deploy's
Android build (OTP per ABI, jniLibs helpers, zig lib<app>.so with plugin
JNI/NIFs, plugin manifest/gradle/kotlin/res/fonts merges), needing no
device. The deploy and ReleaseAndroid.build_aab both run it; the release
builds every abiFilters ABI and refuses one it can't build. Without zig a
leftover lib<app>.so is removed so CMake compiles from source.

NativeBuild.prepare_plugin_build_state!/0 (runtime manifest, driver tables,
migrations, images, warnings) runs in build_all and both release pipelines;
the iOS release linked a stale checked-in driver_tab_ios.c.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r platform checks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@GenericJam

Copy link
Copy Markdown
Owner Author

Proof (scratch app from local mob_new 0.6.7 master mix mob.new scratch404 --android --local, mob master 9d3b71f, no device, no mix mob.deploy ever run):

  1. mix mob.release --android on the fresh app (no jniLibs at all): AAB built, libscratch404.so for arm64-v8a / armeabi-v7a / x86_64, 0 MobSensors symbols (plugin not added yet).
  2. Added {:mob_sensors, "~> 0.1"} + activated in mob.exs.
    • Before (mob_dev 0.7.15 master): mix mob.release --android → AAB base/lib/*/libscratch404.so has 0 MobSensorsBridge symbols (stale .so from step 1 shipped: the MOB-404 bug).
    • After (this branch): mix mob.release --android → llvm-nm -D --defined-only on every ABI's .so in the AAB:
== arm64-v8a
T Java_io_mob_sensors_MobSensorsBridge_nativeDeliverError
T Java_io_mob_sensors_MobSensorsBridge_nativeDeliverReading
T Java_io_mob_sensors_MobSensorsBridge_nativeRegister
== armeabi-v7a  (same 3)
== x86_64       (same 3)

and MobSensorsBridge is in the AAB's dex.

Review: reviewer subagent (Codex rate-limited until 2026-10-09 21:14): MERGE on 47a61ea (round 1 should-fix multi-line abiFilters + 2 nits, round 2 nit, all fixed).

@GenericJam
GenericJam merged commit e09ce33 into master Oct 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant