Skip to content

Commit

Permalink
Sanitizer: Set useLegacyPackaging to true
Browse files Browse the repository at this point in the history
[Why]
Property useLegacyPackaging determin whether to use the legacy convention of compressing all .so files in the APK.
If null, .so files will be uncompressed and page-aligned when minSdk >= 23.
Otherwise, it failed with "INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2" when minSdk >= 23.
And wrap.sh is only available for API level 27 and above.

[How]
Set useLegacyPackaging to true.
Set compileSdk to 27.
Reference: https://developer.android.com/ndk/guides/asan
  • Loading branch information
robotchaoX committed Dec 18, 2023
1 parent 87bf557 commit 3ced853
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sanitizers/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ android {
asan {
initWith debug
debuggable true
compileSdk 27
packagingOptions {
jniLibs {
useLegacyPackaging true
}
}
externalNativeBuild {
cmake {
arguments "-DANDROID_ARM_MODE=arm", "-DANDROID_STL=c++_shared", "-DSANITIZE=asan"
Expand Down

0 comments on commit 3ced853

Please sign in to comment.