Package | Maven Central | Minimum Android API Level | Supported ABIs |
---|---|---|---|
io.sentry:sentry-native-ndk |
19 | "x86", "armeabi-v7a", "x86_64", "arm64-v8a" |
- SDK Documentation
- Discord server for project discussions
- Follow @getsentry on Twitter for updates
The sub-project aims to automatically bundle pre-built sentry-native
binaries together with a Java JNI layer into an Android friendly .aar
package.
The .aar
package also provides prefab support, giving you the possibility to consume the native sentry.h
APIs from your native app code.
If you're using the Sentry Android SDK, this package is included by default already.
Besides the main package in ndk/lib
, a simple Android app for for testing purposes is provided in the ndk/sample
folder.
The ndk
project uses the Gradle build system in combination with CMake. You can either use a suitable IDE (e.g. Android Studio) or the command line to build it.
-
Set a custom
versionName
in thendk/gradle.properties
file -
Publish the package locally
cd ndk ./gradlew :sentry-native-ndk:publishToMavenLocal
-
Consume the build in your app
// usually settings.gradle allprojects { repositories { mavenLocal() } } // usually app/build.gradle android { buildFeatures { prefab = true } } dependencies { implementation("io.sentry:sentry-native-ndk:<version>") }
-
Link the pre-built packages with your native code
# usually app/CMakeLists.txt find_package(sentry-native-ndk REQUIRED CONFIG) target_link_libraries(<app> PRIVATE ${LOG_LIB} sentry-native-ndk::sentry-android sentry-native-ndk::sentry )
Please see the contribution guide.