Skip to content

Building library for Android

Ivan Schütz edited this page Jun 14, 2020 · 20 revisions
  • Install rustup

  • Make sure you've the Android NDK installed, and that the NDK_HOME environment variable points to it. E.g:

echo $NDK_HOME
/Users/foo/Library/Android/sdk/ndk/21.3.6528147/
cargo install cargo-ndk
  • Add toolchains:
rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android 

The list of targets above is not necessarily up to date. See e.g. here for current targets. Use rustup target list to see a list of currently supported targets.

  • Update PATH_TO_ANDROID_REPO in ./scripts/android/create_android.sh to the path of your Android repo local copy.

  • Run the script, which will build the libraries and create symlinks to them in the Android local copy:

sh ./scripts/android/create_android.sh
Clone this wiki locally