Fix 16K alignment for Android build (#2996)

This commit is contained in:
Bart Louwers
2024-11-06 17:47:28 +01:00
committed by GitHub
parent d939eb0576
commit 32c1ab1521
5 changed files with 39 additions and 0 deletions

View File

@@ -162,6 +162,12 @@ jobs:
cp MapLibreAndroidTestApp/build/outputs/apk/drawable/release/MapLibreAndroidTestApp-drawable-release.apk .
cp MapLibreAndroidTestApp/build/outputs/apk/androidTest/drawable/release/MapLibreAndroidTestApp-drawable-release-androidTest.apk .
# https://developer.android.com/guide/practices/page-sizes
- name: Check alignment of .apk
run: |
unzip -o MapLibreAndroidTestApp/build/outputs/apk/drawable/release/MapLibreAndroidTestApp-drawable-release.apk -d /tmp/my_apk_out
scripts/check-alignment.sh /tmp/my_apk_out
- name: Create artifact for benchmark APKs
uses: actions/upload-artifact@v4
with:

View File

@@ -8,6 +8,10 @@
## 11.6.1
### 🐞 Bug fixes
- Fix 16K alignment Android builds ([#2995](https://github.com/maplibre/maplibre-native/issues/2995)).
### ✨ Features and improvements
- Allow configuring a `Call.Factory` instead of a `OkHttpClient` ([https://github.com/maplibre/maplibre-native/pull/2987](#2987)). Since an `OkHttpClient` can be assigned to a `Call.Factory` this should not cause any issues.

View File

@@ -48,6 +48,8 @@ tasks.withType<DokkaTask> {
}
android {
ndkVersion = Versions.ndkVersion
defaultConfig {
compileSdk = 34
minSdk = 21

View File

@@ -19,6 +19,8 @@ fun obtainTestBuildType(): String {
}
android {
ndkVersion = Versions.ndkVersion
compileSdk = 34
defaultConfig {

View File

@@ -0,0 +1,25 @@
#!/bin/bash
# usage: alignment.sh path to search for *.so files
dir="$1"
matches="$(find $dir -name "*.so" -type f)"
IFS=$'\n'
err=0
for match in $matches; do
res="$(objdump -p ${match} | grep LOAD | awk '{ print $NF }' | head -1)"
if [[ $res =~ "2**14" ]] || [[ $res =~ "2**16" ]]; then
echo -e "${match}: ALIGNED ($res)"
else
if [[ "$match" == *"x86_64"* || "$match" == *"arm64-v8a"* ]]; then
echo "ERROR:"
err=1
fi
echo -e "${match}: UNALIGNED ($res)"
fi
done
exit $err