Skip to content

Commit 867b0d7

Browse files
committed
Use different Android API versions depending on the target arch
1 parent a940307 commit 867b0d7

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

ci/android-install-ndk.sh

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,39 @@
1212
set -ex
1313

1414
NDK=android-ndk-r19c
15-
API=26
1615
curl --retry 10 -O https://dl.google.com/android/repository/${NDK}-linux-x86_64.zip
1716
unzip -q ${NDK}-linux-x86_64.zip
1817

1918
case "$1" in
19+
arm)
20+
arch=arm
21+
api=25
22+
;;
23+
armv7)
24+
arch=arm
25+
api=25
26+
;;
2027
aarch64)
2128
arch=arm64
29+
api=25
2230
;;
23-
2431
i686)
2532
arch=x86
33+
api=28
34+
;;
35+
x86_64)
36+
arch=x86_64
37+
api=28
2638
;;
27-
2839
*)
29-
arch=$1
40+
echo "invalid arch: $1"
41+
exit 1
3042
;;
3143
esac;
3244

3345
${NDK}/build/tools/make_standalone_toolchain.py \
3446
--install-dir "/android/ndk-${1}" \
3547
--arch "${arch}" \
36-
--api ${API}
48+
--api ${api}
3749

3850
rm -rf ./${NDK}-linux-x86_64.zip ./${NDK}

ci/android-install-sdk.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,26 @@ set -ex
1919
# which apparently magically accepts the licenses.
2020

2121
SDK=4333796
22-
API=26
22+
API=25
2323
mkdir sdk
2424
curl --retry 10 https://dl.google.com/android/repository/sdk-tools-linux-${SDK}.zip -O
2525
unzip -d sdk sdk-tools-linux-${SDK}.zip
2626

2727
case "$1" in
2828
arm | armv7)
29-
abi=armeabi-v7a
29+
image=system-images;android-25;google_apis;armeabi-v7a
3030
;;
3131

3232
aarch64)
33-
abi=arm64-v8a
33+
image=system-images;android-25;google_apis;arm64-v8a
3434
;;
3535

3636
i686)
37-
abi=x86
37+
image=system-images;android-28;default;x86
3838
;;
3939

4040
x86_64)
41-
abi=x86_64
41+
image=system-images;android-28;default;x86_64
4242
;;
4343

4444
*)
@@ -63,9 +63,9 @@ yes | ./sdk/tools/bin/sdkmanager --no_https \
6363
"emulator" \
6464
"platform-tools" \
6565
"platforms;android-${API}" \
66-
"system-images;android-${API};default;$abi"
66+
"${image}"
6767

6868
echo "no" |
6969
./sdk/tools/bin/avdmanager create avd \
7070
--name "${1}" \
71-
--package "system-images;android-${API};default;$abi"
71+
--package "${image}"

0 commit comments

Comments
 (0)