|
18 | 18 | : Android Open Source Project
|
19 | 19 | Feedback
|
20 | 20 | : https://issuetracker.google.com/issues/new?component=192708
|
| 21 | +Since |
| 22 | +: 8.10.0 (May 2025) |
21 | 23 | Affects
|
22 | 24 | : Gradle build files and TOML files
|
23 | 25 | Editing
|
24 | | -: This check can *not* run live in the IDE editor |
| 26 | +: This check runs on the fly in the IDE editor |
25 | 27 | See
|
26 | 28 | : https://developer.android.com/guide/practices/page-sizes
|
27 | 29 | Implementation
|
28 | 30 | : [Source Code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-checks/src/main/java/com/android/tools/lint/checks/PageAlignmentDetector.kt)
|
29 | 31 | Tests
|
30 | 32 | : [Source Code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-tests/src/test/java/com/android/tools/lint/checks/PageAlignmentDetectorTest.kt)
|
31 | | -Copyright Year |
32 | | -: 2025 |
33 | | - |
34 | | -Historically, Android has aligned memory using 4 KB memory page sizes, |
35 | | -which optimized system memory performance for the average amount of |
36 | | -total memory that Android devices have typically had. |
37 | | - |
38 | | -To support devices that only support 16 KB aligned libraries in the |
39 | | -future, the Google Play Store will soon require all apps to be compiled |
40 | | -with 16 KB aligned libraries. |
41 | | - |
42 | | -An app compiled with 4 KB aligned libraries will not work correctly on |
43 | | -these devices. To ensure compatibility with these devices and to |
44 | | -future-proof your app, the Play Store will require native libraries to |
45 | | -be aligned to 16 KB boundaries. |
46 | | - |
47 | | -If your app uses any NDK libraries, either directly or indirectly |
48 | | -through an SDK, you'll need to rebuild your app to meet this new |
49 | | -requirement. This means ensuring that all native libraries within your |
50 | | -app, including those from any dependencies, are built with 16 KB page |
51 | | -alignment. |
52 | | - |
53 | | -This lint check helps identify potential issues by inspecting all |
54 | | -transitive libraries your app depends on. If any nested native libraries |
55 | | -are found to be aligned only to 4 KB, you'll need to take action. |
56 | | - |
57 | | -If lint flags a library, try updating to a newer version that supports |
58 | | -16 KB alignment. If no updated version is available, reach out to the |
59 | | -library vendor for assistance. |
| 33 | + |
| 34 | +Android has traditionally used 4 KB memory page sizes. However, to |
| 35 | +support future devices that only work with 16 KB aligned libraries apps |
| 36 | +containing native libraries need to be built with 16 KB alignment. |
| 37 | + |
| 38 | +Apps with 4 KB aligned native libraries may not work correctly on |
| 39 | +devices requiring 16 KB alignment. To ensure compatibility and |
| 40 | +future-proof your app, it is strongly recommended that your native |
| 41 | +libraries are aligned to 16 KB boundaries. |
| 42 | + |
| 43 | +If your app uses any NDK libraries, directly or indirectly through an |
| 44 | +SDK, you should rebuild your app to meet this recommendation. Make sure |
| 45 | +all native libraries within your application, including those from |
| 46 | +dependencies, are built with 16 KB page alignment. |
| 47 | + |
| 48 | +This lint check looks at all native libraries that your app depends on. |
| 49 | +If any are found to be aligned to 4 KB instead of 16 KB, you will need |
| 50 | +to address this. |
| 51 | + |
| 52 | +When a library is flagged, first try to update to a newer version that |
| 53 | +supports 16 KB alignment. If an updated version is not available, |
| 54 | +contact the library vendor to ask about their plans for 16 KB support |
| 55 | +and request a compatible version. Updating your libraries proactively |
| 56 | +will help ensure your app works properly on a wider range of devices. |
60 | 57 |
|
61 | 58 | (##) Example
|
62 | 59 |
|
|
0 commit comments