Shipping production ready Rust for Android
summary
Rust eliminates most memory‑safety bugs and industry teams report ~65–70% of severe vulnerabilities are memory related, so Mozilla compiles Rust into Android native libraries, merges crates into a Megazord to avoid duplicate std libs, uses a Rust Android Gradle plugin to build, and generates safe JNI glue from a single UDL with an open source tool called UniFi. The system ships in Firefox Sync and works but requires careful handling of threads, forbids bundling async runtimes (calls block the caller), and still causes developer friction crossing between Kotlin/JVM and native layers.
AI-written summary · about
chapters (13)
- 0:00Introduction to Rust on Android
- 1:31What is Rust and why it matters
- 8:36Memory safety in Rust vs industry
- 10:22When to use Rust in Android
- 12:49How to integrate Rust in Android
- 13:31Problems with Rust integration
- 15:39Megazord and Rust libraries
- 16:21The FFI sandwich explained
- 20:53Cotlin layer for Rust FFI
- 22:20Solving FFI complexity with UniFi
- 25:11Mozilla's Rust integration system
- 26:58Limitations of Rust in Android
- 28:50Threading and async challenges
related talks
01h 21mLeveraging Rust to build cross-platform mobile libraries
34mTransitioning to memory safety: lessons from the Android project
37mUsing Rust in Your Next KMP App
04m"Scaling Safety: Rust at Google”
51mRust in the Linux kernel
37mRust for Linux
39mSeamless Multiplatform – Kotlin-Rust-Multiplatform?!
37mSharing Code between iOS & Android with Rust
