Can NDK support rust library build

544 views
Skip to first unread message

PENGYING XU

unread,
Jan 9, 2024, 10:11:22 AMJan 9
to android-ndk
Rust has been used in AOSP build and created some new libraries.
I want to know if it can add rust build support in NDK to make application developed with Rust easy.

Florian Mayer

unread,
Jan 9, 2024, 12:15:23 PMJan 9
to andro...@googlegroups.com
The NDK doesn't officially support Rust, but it's not impossible. See the NDK page about Memory error debugging and mitigation:
The officially supported memory safe languages for Android are Java and Kotlin. Most Android applications are easier to develop in one of those languages.
That said, there are app developers shipping code written in Rust, and if you're reading this page you probably do have a good reason to need native code (portability, performance, or both). Rust is the best choice for memory safe native code on Android. The NDK team is not necessarily able to help you with the problems you face if you go that route, but we are interested in hearing about them

On Tue, 9 Jan 2024 at 07:11, PENGYING XU <xpy66...@gmail.com> wrote:
Rust has been used in AOSP build and created some new libraries.
I want to know if it can add rust build support in NDK to make application developed with Rust easy.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/1109cfb5-764b-4aef-889d-cd879ae530a7n%40googlegroups.com.

Dan Albert

unread,
Jan 9, 2024, 7:57:13 PMJan 9
to andro...@googlegroups.com
Subscribe to https://github.com/android/ndk/issues/1742 using the button on the right (or the bottom if you're on mobile).

(additional feedback isn't needed, we already know people want it, but as you can see from that bug it's a rather large task)

There are a variety of unsupported workflows for doing it today. I won't link any specific examples because I've got no idea which ones are any good, but they should be easy to find with a web search.

James Farrell

unread,
Jan 10, 2024, 10:51:05 AMJan 10
to andro...@googlegroups.com
Here's an unofficial example of using Rust with the NDK: https://github.com/jfgoog/android-rs-examples

-- James


Reply all
Reply to author
Forward
0 new messages