Closed HariPrasanthR closed 2 years ago
This is an optional step to strip. As part of building the app, a gradle task to strip is already there.
add_custom_command( TARGET native-lib POST_BUILD COMMAND "${ANDROID_TOOLCHAIN_PREFIX}strip" -R .comment -g -S -d --strip-unneeded ${CMAKE_HOME_DIRECTORY}/../../../build/intermediates/cmake/${CMAKE_BUILD_TYPE}/obj/${ANDROID_ABI}/libnative-lib.so COMMENT "Stripped native library")
If you want to really use the above command, set the path to llvm-strip available in ....../Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/
FAILED: /Users/hariprasanth.ramesh/StudioProjects/DetectFrida/app/build/intermediates/cmake/debug/obj/arm64-v8a/libnative-lib.so : && /Users/hariprasanth.ramesh/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang --target=aarch64-none-linux-android21 --gcc-toolchain=/Users/hariprasanth.ramesh/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64 --sysroot=/Users/hariprasanth.ramesh/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fno-limit-debug-info -static-libstdc++ -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -shared -Wl,-soname,libnative-lib.so -o /Users/hariprasanth.ramesh/StudioProjects/DetectFrida/app/build/intermediates/cmake/debug/obj/arm64-v8a/libnative-lib.so CMakeFiles/native-lib.dir/native-lib.c.o -llog -latomic -lm && cd /Users/hariprasanth.ramesh/StudioProjects/DetectFrida/app/.cxx/cmake/debug/arm64-v8a && /Users/hariprasanth.ramesh/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-strip -R .comment -g -S -d --strip-unneeded /Users/hariprasanth.ramesh/StudioProjects/DetectFrida/app/src/main/c/../../../build/intermediates/cmake/Debug/obj/arm64-v8a/libnative-lib.so /bin/sh: /Users/hariprasanth.ramesh/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-strip: No such file or directory ninja: build stopped: subcommand failed.