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.

[How]
Set useLegacyPackaging to true when miniSdk >=23.
Reference: https://developer.android.com/ndk/guides/asan
  • Loading branch information
robotchaoX committed Dec 14, 2023
1 parent 87bf557 commit 959797b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sanitizers/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {

defaultConfig {
applicationId "com.example.sanitizers"
minSdk 21
minSdk 23
targetSdk 32
versionCode 1
versionName "1.0"
Expand Down Expand Up @@ -65,6 +65,11 @@ android {
version '3.18.1'
}
}
packagingOptions {
jniLibs {
useLegacyPackaging true
}
}
buildFeatures {
viewBinding true
}
Expand Down

0 comments on commit 959797b

Please sign in to comment.