Skip to content

Commit 30a61d3

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

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

examples/whisper.android/app/build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,21 @@ android {
2222
}
2323

2424
buildTypes {
25+
debug {
26+
// When the AGP build type is Debug, the native (NDK/CMake) build does not run
27+
// compiler optimizations by default, causing a critical performance issue.
28+
// We force CMAKE_BUILD_TYPE to Release here so native code stays optimized
29+
// even in Debug AGP builds.
30+
arguments "-DCMAKE_BUILD_TYPE=Release"
31+
}
32+
2533
release {
2634
signingConfig signingConfigs.debug
2735
minifyEnabled true
2836
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
2937
}
3038
}
39+
3140
compileOptions {
3241
sourceCompatibility JavaVersion.VERSION_17
3342
targetCompatibility JavaVersion.VERSION_17

0 commit comments

Comments
 (0)