OpenParable
Skip to content
← Back to skills

build-native

Development

Build connect_norito_bridge native .so files from Rust source. Use when user says "build native", "build .so", "rebuild native libs", "update native bridge", or "cargo ndk build".

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/hyperledger-iroha/iroha/blob/HEAD/kotlin/.claude/skills/build-native/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/build-native, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Build Native Libraries

Builds libconnect_norito_bridge.so for Android from the Rust crate at crates/connect_norito_bridge in the iroha repository. The Kotlin SDK lives next to the java/ directory in the same repo, so the Rust source is at ../../crates/connect_norito_bridge relative to this project.

Prerequisites

  • Rust toolchain (1.92+) with Android targets: aarch64-linux-android, x86_64-linux-android
  • cargo-ndk installed: cargo install cargo-ndk
  • ANDROID_NDK_HOME environment variable set (NDK 28+)

Build with Gradle task

./gradlew :offline-wallet-android:buildNativeLibs

The task reads iroha.dir from local.properties and runs cargo ndk. Output goes to offline-wallet-android/src/main/jniLibs/.

Manual build

1. Validate environment

which cargo-ndk || cargo install cargo-ndk
echo $ANDROID_NDK_HOME
rustup target list --installed | grep android

If targets are missing:

rustup target add aarch64-linux-android x86_64-linux-android

2. Build

From the iroha repository root:

cargo ndk -t arm64-v8a -t x86_64 \
  -o <kotlin-sdk-dir>/offline-wallet-android/src/main/jniLibs \
  build --release -p connect_norito_bridge

Target ABIs:

  • arm64-v8a — production devices (required)
  • x86_64 — emulators (required for development)
  • armeabi-v7a — skip (upstream rkyv crate incompatible with 32-bit)

3. Verify

ls -lh offline-wallet-android/src/main/jniLibs/arm64-v8a/libconnect_norito_bridge.so  # ~14MB
ls -lh offline-wallet-android/src/main/jniLibs/x86_64/libconnect_norito_bridge.so      # ~18MB

Known issues

  • armeabi-v7a fails — rkyv crate has a const evaluation overflow on 32-bit targets. This is upstream; skip this ABI.
  • Long build time — First build compiles all Rust dependencies (~5-10 min). Incremental builds are faster.
  • Rust version — Project requires rustc 1.92+. Check with rustc --version.