build-native
DevelopmentBuild 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".
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
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-ndkinstalled:cargo install cargo-ndkANDROID_NDK_HOMEenvironment 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 (upstreamrkyvcrate 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 —
rkyvcrate has aconstevaluation 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.