Skip to content

Commit 2892f9d

Browse files
committed
fix/android-debug-inference-issue: Applied BUILD_TYPE=Release to NDK build of whisper.android.java example
1 parent 30a61d3 commit 2892f9d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

examples/whisper.android.java/app/build.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ android {
2525
}
2626

2727
buildTypes {
28+
debug {
29+
// When the AGP build type is Debug, the native (NDK/CMake) build does not run
30+
// compiler optimizations by default, causing a critical performance issue.
31+
// We force CMAKE_BUILD_TYPE to Release here so native code stays optimized
32+
// even in Debug AGP builds.
33+
arguments += "-DCMAKE_BUILD_TYPE=Release"
34+
}
35+
2836
release {
2937
signingConfig signingConfigs.debug
3038
minifyEnabled true

0 commit comments

Comments
 (0)