Fix 16K alignment for Android build (#2996)
This commit is contained in:
6
.github/workflows/android-ci.yml
vendored
6
.github/workflows/android-ci.yml
vendored
@@ -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:
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -48,6 +48,8 @@ tasks.withType<DokkaTask> {
|
||||
}
|
||||
|
||||
android {
|
||||
ndkVersion = Versions.ndkVersion
|
||||
|
||||
defaultConfig {
|
||||
compileSdk = 34
|
||||
minSdk = 21
|
||||
|
||||
@@ -19,6 +19,8 @@ fun obtainTestBuildType(): String {
|
||||
}
|
||||
|
||||
android {
|
||||
ndkVersion = Versions.ndkVersion
|
||||
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
|
||||
25
platform/android/scripts/check-alignment.sh
Executable file
25
platform/android/scripts/check-alignment.sh
Executable 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
|
||||
Reference in New Issue
Block a user