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

1
android {
2
defaultConfig {
3
ndk {
4
abiFilters "arm64-v8a", "x86_64"
5
}
6
}
7
}

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.