From 5c0aa312954cf9d80d408036e5964b3a4f6c8902 Mon Sep 17 00:00:00 2001 From: gords2 Date: Sat, 20 Jun 2026 20:18:39 -0700 Subject: [PATCH] Add Kotlin (build.gradle.kts) snippet for NDK prefab dependency The 'Allowing the Compiler to Link Libraries' section showed a single dependency block using Kotlin DSL syntax but labelled with the Groovy filename (app/build.gradle). Split it into a Groovy (app/build.gradle) block and a Kotlin DSL (app/build.gradle.kts) block, matching the Groovy/Kotlin pattern already used elsewhere on this page, so Flutter 3.29+ / modern Android projects that use the Kotlin Gradle DSL have a copy-pasteable example. Closes #12902 --- .../android/configuration/using-ndk.mdx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/platforms/android/configuration/using-ndk.mdx b/docs/platforms/android/configuration/using-ndk.mdx index 74b8a6fe7e514..10fd0307b7359 100644 --- a/docs/platforms/android/configuration/using-ndk.mdx +++ b/docs/platforms/android/configuration/using-ndk.mdx @@ -37,7 +37,21 @@ Android prefab support can only be used with Sentry Android SDK version 8.0.0 an Enable prefab and add the sentry-native ndk dependency directly to your module: -```kotlin {filename:app/build.gradle} +```groovy {filename:app/build.gradle} +android { + buildFeatures { + prefab true + } +} + +dependencies { + // The version MUST match with the version the Sentry Android SDK is using. + // See https://github.com/getsentry/sentry-java/blob/{{@inject packages.version('sentry.java.android', '8.21.1') }}/gradle/libs.versions.toml + implementation 'io.sentry:sentry-native-ndk:' +} +``` + +```kotlin {filename:app/build.gradle.kts} android { buildFeatures { prefab = true