# Build and Release Configuration

Android Offline Navigation includes native components for offline routing. Configure release builds so the application only targets supported native ABIs and keeps the SDK’s packaged optimization rules intact.

## Limit Application ABIs

```kotlin
android {
    defaultConfig {
        ndk {
            abiFilters "arm64-v8a", "x86_64"
        }
    }
}
```

For a physical-device-only release, you can include only arm64-v8a. The current offline AAR does not provide _libvalhalla_mobile_jni.so_ for armeabi-v7a or x86. Do not expose unsupported ABIs as installable targets. An App Bundle can split delivery by ABI.

## R8 and ProGuard

A standard Gradle AAR integration automatically merges the consumer ProGuard rules packaged with the SDK. You do not need a package-wide keep rule for `ai.nextbillion.**`, and you should not disable R8 optimization. The SDK rules already cover JNI, native callbacks, Retrofit, Gson, Parcelable, and serialization entry points.

Before release:

-   Preserve the AAR consumer rules and `JNI` directory if your build process repackages or relocates dependencies.
-   Do not use `pickFirst` to hide duplicate native-library conflicts without confirming each library’s origin.
-   Build the customer Release variant with _minifyEnabled_ and _shrinkResources_ enabled, run a smoke test for initialization, catalog loading, downloads, cancellation, and offline routing on a physical device.
