Skip to content

Commit d61e755

Browse files
committed
fix/android-debug-inference-issue: Applied BUILD_TYPE=Release to NDK build of whisper.android.java example
1 parent 3c0ea8a commit d61e755

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

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

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

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

0 commit comments

Comments
 (0)