|
| 1 | +# Android 16 KB Page Size Support |
| 2 | + |
| 3 | +This document describes the changes made to support 16 KB memory page sizes required for Android 15+ compatibility. |
| 4 | + |
| 5 | +## Background |
| 6 | + |
| 7 | +Google Play requires all apps targeting Android 15+ (SDK 35+) to support 16 KB memory page sizes. This ensures compatibility with devices that use 16 KB memory pages instead of the traditional 4 KB pages for improved performance. |
| 8 | + |
| 9 | +## Changes Made |
| 10 | + |
| 11 | +### 1. Gradle Properties (`android/gradle.properties`) |
| 12 | +- Added `android.enablePageSizeSupport=true` to enable 16 KB page size support |
| 13 | +- Increased JVM heap size from 1536m to 2048m for better memory handling |
| 14 | +- Added `android.enableR8.fullMode=true` for additional optimizations |
| 15 | + |
| 16 | +### 2. App Build Configuration (`android/app/build.gradle`) |
| 17 | +- Added NDK configuration with explicit ABI filters to ensure proper native library alignment |
| 18 | +- Added packaging options to disable legacy packaging for proper 16 KB alignment |
| 19 | +- Enhanced debug build type configuration |
| 20 | + |
| 21 | +### 3. Build Tools |
| 22 | +- Confirmed Android Gradle Plugin 8.9.1 is used (supports 16 KB page sizes) |
| 23 | + |
| 24 | +## Verification |
| 25 | + |
| 26 | +To verify that the app supports 16 KB page sizes: |
| 27 | + |
| 28 | +1. **Build the app:** |
| 29 | + ```bash |
| 30 | + cd android |
| 31 | + ./gradlew assembleRelease |
| 32 | + ``` |
| 33 | + |
| 34 | +2. **Test on 16 KB devices:** |
| 35 | + - Use Android emulator with 16 KB page size configuration |
| 36 | + - Test on physical devices with 16 KB page sizes |
| 37 | + - Use Google Play Console's app bundle explorer to verify 16 KB support |
| 38 | + |
| 39 | +3. **Check build output:** |
| 40 | + - Ensure no errors related to memory alignment |
| 41 | + - Verify all native libraries are properly packaged |
| 42 | + |
| 43 | +## Google Play Console Verification |
| 44 | + |
| 45 | +After building and uploading the app bundle to Google Play Console: |
| 46 | +1. Go to Release management > App bundle explorer |
| 47 | +2. Select the latest app bundle |
| 48 | +3. Check if "16 KB page size support" is listed as supported |
| 49 | + |
| 50 | +## Testing Recommendations |
| 51 | + |
| 52 | +- Test the app on devices/emulators with 16 KB page sizes |
| 53 | +- Verify all camera functionality works correctly |
| 54 | +- Test media capture and storage operations |
| 55 | +- Ensure all Capacitor plugins function properly |
| 56 | + |
| 57 | +## References |
| 58 | + |
| 59 | +- [Supporting 16 KB devices](https://developer.android.com/guide/practices/page-sizes#build) |
| 60 | +- [Prepare your Play app for 16 KB page sizes](https://www.youtube.com/watch?v=MnMGJhuChRI) |
| 61 | +- [Technical requirement announcement](https://android-developers.googleblog.com/2025/05/prepare-play-apps-for-devices-with-16kb-page-size.html) |
0 commit comments