• Docs >
  • Using Android prebuilt libraries (AAR)
Shortcuts

Using Android prebuilt libraries (AAR)

We provide two prebuilt Android libraries (AAR), executorch.aar for generic use case (image/audio processing) and executorch_llama.aar for LLAMA use case.

Contents of libraries

  • executorch.aar

    • Java library

    • JNI contains the JNI binding for NativePeer.java and ExecuTorch native library, including core ExecuTorch runtime libraries, XNNPACK backend, Portable kernels, Optimized kernels, and Quantized kernels.

      • Comes with two ABI variants, arm64-v8a and x86_64.

  • executorch_llama.aar

    • Java library (Note: it contains the same Java classes as the previous Java, but it does not contain the JNI binding for generic Module/NativePeer Java code).

    • JNI contains the JNI binding for LlamaModule.java and ExecuTorch native library, including core ExecuTorch runtime libraries, XNNPACK backend, Portable kernels, Optimized kernels, Quantized kernels, and LLAMA-specific Custom ops library.

      • Comes with two ABI variants, arm64-v8a and x86_64.

Using prebuilt libraries

To add the Java library to your app, simply download the AAR, and add it to your gradle build rule.

In your app working directory, such as example executorch/examples/demo-apps/android/LlamaDemo,

mkdir -p app/libs
curl https://ossci-android.s3.amazonaws.com/executorch/release/v0.5.0-rc3/executorch.aar -o app/libs/executorch.aar

And include it in gradle:

# app/build.grardle.kts
dependencies {
    implementation(files("libs/executorch.aar"))
}

Now you can compile your app with the ExecuTorch Android library.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources