diff --git a/build/build_android_llm_demo.sh b/build/build_android_llm_demo.sh index 3f80d379b4a..1f8a554edc2 100644 --- a/build/build_android_llm_demo.sh +++ b/build/build_android_llm_demo.sh @@ -112,6 +112,9 @@ build_aar() { # Rename libexecutorch_jni.so to libexecutorch.so for soname consistency # between Java and JNI find jni -type f -name "libexecutorch_jni.so" -exec bash -c 'mv "$1" "${1/_jni/}"' bash {} \; + if [ "$EXECUTORCH_CMAKE_BUILD_TYPE" == "Release" ]; then + find jni -type f -name "*.so" -exec "$ANDROID_NDK"/toolchains/llvm/prebuilt/*/bin/llvm-strip {} \; + fi # Zip all necessary files into the AAR file zip -r executorch.aar libs jni/*/libexecutorch.so jni/*/libqnn*.so jni/*/libQnn*.so jni/*/libneuron_backend.so jni/*/libneuron_buffer_allocator.so jni/*/libneuronusdk_adapter.mtk.so AndroidManifest.xml popd