Skip to content
Snippets Groups Projects
Commit eb0794a5 authored by gnzlbg's avatar gnzlbg
Browse files

Update Android SDK, NDK (r19c), and API versions (arm:24,x86:28)

* Update Android NDK to version r19c
* Update Android API versions to:
  * API 24 on arm and aarch64 targets
  * API 28 on x86 and x86_64 targets
* Unified headers were removed in NDK 16
* Refactor the NDK and SDK installation scripts
* OpenJDK version 8 must be kept: it appears that
  the Android tools do not work with more modern OpenJDK
  versions.
parent f3a7aade
No related branches found
No related tags found
Loading
...@@ -11,27 +11,40 @@ ...@@ -11,27 +11,40 @@
set -ex set -ex
curl --retry 10 -O https://dl.google.com/android/repository/android-ndk-r15b-linux-x86_64.zip NDK=android-ndk-r19c
unzip -q android-ndk-r15b-linux-x86_64.zip curl --retry 10 -O https://dl.google.com/android/repository/${NDK}-linux-x86_64.zip
unzip -q ${NDK}-linux-x86_64.zip
case "$1" in case "$1" in
arm)
arch=arm
api=24
;;
armv7)
arch=arm
api=24
;;
aarch64) aarch64)
arch=arm64 arch=arm64
api=24
;; ;;
i686) i686)
arch=x86 arch=x86
api=28
;;
x86_64)
arch=x86_64
api=28
;; ;;
*) *)
arch=$1 echo "invalid arch: $1"
exit 1
;; ;;
esac; esac;
android-ndk-r15b/build/tools/make_standalone_toolchain.py \ ${NDK}/build/tools/make_standalone_toolchain.py \
--unified-headers \
--install-dir "/android/ndk-${1}" \ --install-dir "/android/ndk-${1}" \
--arch "${arch}" \ --arch "${arch}" \
--api 24 --api ${api}
rm -rf ./android-ndk-r15b-linux-x86_64.zip ./android-ndk-r15b rm -rf ./${NDK}-linux-x86_64.zip ./${NDK}
...@@ -18,46 +18,56 @@ set -ex ...@@ -18,46 +18,56 @@ set -ex
# located in https://github.com/appunite/docker by just wrapping it in a script # located in https://github.com/appunite/docker by just wrapping it in a script
# which apparently magically accepts the licenses. # which apparently magically accepts the licenses.
SDK=4333796
mkdir sdk mkdir sdk
curl --retry 10 https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip -O curl --retry 10 https://dl.google.com/android/repository/sdk-tools-linux-${SDK}.zip -O
unzip -d sdk sdk-tools-linux-3859397.zip unzip -q -d sdk sdk-tools-linux-${SDK}.zip
case "$1" in case "$1" in
arm | armv7) arm | armv7)
abi=armeabi-v7a api=24
image="system-images;android-${api};google_apis;armeabi-v7a"
;; ;;
aarch64) aarch64)
abi=arm64-v8a api=24
image="system-images;android-${api};google_apis;arm64-v8a"
;; ;;
i686) i686)
abi=x86 api=28
image="system-images;android-${api};default;x86"
;; ;;
x86_64) x86_64)
abi=x86_64 api=28
image="system-images;android-${api};default;x86_64"
;; ;;
*) *)
echo "invalid arch: $1" echo "invalid arch: $1"
exit 1 exit 1
;; ;;
esac; esac;
# See: https://stackoverflow.com/a/51644855/1422197 # Try to fix warning about missing file.
export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee' # See https://askubuntu.com/a/1078784
mkdir -p /root/.android/
echo '### User Sources for Android SDK Manager' >> /root/.android/repositories.cfg
echo '#Fri Nov 03 10:11:27 CET 2017 count=0' >> /root/.android/repositories.cfg
# Print all available packages
# yes | ./sdk/tools/bin/sdkmanager --list --verbose
# --no_https avoids # --no_https avoids
# javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found # javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
yes | ./sdk/tools/bin/sdkmanager --licenses --no_https #
# | grep -v = || true removes the progress bar output from the sdkmanager
# which produces an insane amount of output.
yes | ./sdk/tools/bin/sdkmanager --licenses --no_https | grep -v = || true
yes | ./sdk/tools/bin/sdkmanager --no_https \ yes | ./sdk/tools/bin/sdkmanager --no_https \
"emulator" \ "emulator" \
"platform-tools" \ "platform-tools" \
"platforms;android-24" \ "platforms;android-${api}" \
"system-images;android-24;default;$abi" "${image}" | grep -v = || true
echo "no" | echo "no" |
./sdk/tools/bin/avdmanager create avd \ ./sdk/tools/bin/avdmanager create avd \
--name "${1}" \ --name "${1}" \
--package "system-images;android-24;default;$abi" --package "${image}" | grep -v = || true
...@@ -9,7 +9,7 @@ RUN dpkg --add-architecture i386 && \ ...@@ -9,7 +9,7 @@ RUN dpkg --add-architecture i386 && \
python \ python \
unzip \ unzip \
expect \ expect \
openjdk-11-jre \ openjdk-8-jre \
libstdc++6:i386 \ libstdc++6:i386 \
libpulse0 \ libpulse0 \
gcc \ gcc \
......
...@@ -9,7 +9,7 @@ RUN dpkg --add-architecture i386 && \ ...@@ -9,7 +9,7 @@ RUN dpkg --add-architecture i386 && \
python \ python \
unzip \ unzip \
expect \ expect \
openjdk-11-jre \ openjdk-8-jre \
libstdc++6:i386 \ libstdc++6:i386 \
libpulse0 \ libpulse0 \
gcc \ gcc \
......
...@@ -9,7 +9,7 @@ RUN dpkg --add-architecture i386 && \ ...@@ -9,7 +9,7 @@ RUN dpkg --add-architecture i386 && \
python \ python \
unzip \ unzip \
expect \ expect \
openjdk-11-jre \ openjdk-8-jre \
libstdc++6:i386 \ libstdc++6:i386 \
libpulse0 \ libpulse0 \
gcc \ gcc \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment