Repository navigation
AMap SDK has no 16 KB page-aligned release, and the latest version drops x86_64 #66
Description
The AMap SDK is the last thing in the build that is not 16 KB page-aligned. Unlike the other
libraries in #47, this one cannot be fixed by bumping: the newest release available is
still 4 KB aligned.
Measured
Alignment read from the PT_LOAD segments of the published artifacts with the NDK's
llvm-readelf, not from release notes:
| Version | Artifact | arm64-v8a alignment |
|---|---|---|
9.8.3 (current pin) |
3dmap-9.8.3.aar |
0x1000 — 4 KB |
10.0.600 (latest) |
3dmap-10.0.600.jar |
0x1000 — 4 KB |
For comparison, everything else in the APK is now 0x4000 after the fixes in #47.
A second problem with 10.0.600
Even setting alignment aside, the latest release is not a drop-in:
- it is published as a
.jar, not an.aar(3dmap-10.0.600.aaris a 404 on Maven Central) - it ships only
armeabi-v7aandarm64-v8a— nox86_64
app/build.gradle.kts sets abiFilters to arm64-v8a and x86_64, and the Gradle managed
device the instrumented tests run on is x86_64. So bumping AMap would break the test device
while still not fixing alignment.
Current state
With #47's other fixes applied, the debug APK is 26 aligned / 2 unaligned, and both
remaining entries are libAMapSDK_MAP_v9_8_3.so (one per ABI).
This is not currently blocking anything. The app is distributed as APKs on GitHub releases —
build-release.yml does not build an AAB — so there is no store policy gate involved. The
reason it still matters is hardware: 16 KB page size is becoming the default on new arm64
devices, and an unaligned library will eventually fail to load rather than warn.
Options, for whoever picks this up
- Wait for AMap. There is no public issue tracker for the SDK; the vendor channel is
https://lbs.amap.com. Somebody who can file there should ask for a 16 KB-aligned build. - Product flavour. Keep AMap in a sideload-oriented variant and ship a fully aligned
variant without it. Costs a build variant and aMapProviderFactorythat varies by flavour. - Drop the AMap provider. Fully aligned, simplest build, but leaves mainland China users
with no working map — Google Maps is unavailable there, which is why Merge SadGare's fork: FindMy 0.9.x, map providers, and working key alignment #49 added AMap.
Worth noting #51 (replace AMapProvider's reflection with direct SDK calls) and #52 (verify
the provider still works after the fork merge) are both open, so the provider's current state
is not confirmed either way.
How to reproduce the measurement
# any .so, from an APK or an unpacked AAR/JAR
llvm-readelf -l -W libAMapSDK_MAP_v9_8_3.so | awk '$1 == "LOAD" { print $NF }'
# 0x4000 or greater is 16 KB compatible; 0x1000 is notThis issue was written by Claude Code.
Activity
Align the native libraries to 16 KB pages