Android
The Android generator produces a Gradle android-library template with:
- Kotlin wrapper
WeaveFFIthat declaresexternal funs - JNI C shims that call into the generated C ABI
CMakeLists.txtfor building the shared library
Generated artifacts
generated/android/settings.gradlegenerated/android/build.gradlegenerated/android/src/main/java/com/weaveffi/WeaveFFI.ktgenerated/android/src/main/cpp/{weaveffi_jni.c,CMakeLists.txt}
Build steps
- Ensure Android SDK and NDK are installed (Android Studio recommended).
- Open
generated/androidin Android Studio. - Sync Gradle and build the
:weaveffiAAR. - Integrate the AAR into your app module. Ensure your app loads the Rust-produced
native library (e.g.,
libcalculator) at runtime on device/emulator.
The JNI shims convert strings/bytes and propagate errors by throwing RuntimeException.