From 9ca5bd05722691e93354b97c46ae7487c1c2a90f Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 11 Mar 2020 10:42:22 +0300 Subject: [PATCH 1/7] Fix android tools installation --- images/linux/scripts/installers/1604/android.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/images/linux/scripts/installers/1604/android.sh b/images/linux/scripts/installers/1604/android.sh index 95a44edc..c9b4d9d2 100644 --- a/images/linux/scripts/installers/1604/android.sh +++ b/images/linux/scripts/installers/1604/android.sh @@ -19,11 +19,11 @@ echo "ANDROID_HOME=${ANDROID_SDK_ROOT}" | tee -a /etc/environment # Download the latest command line tools so that we can accept all of the licenses. # See https://developer.android.com/studio/#command-tools wget -O android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip -unzip android-sdk.zip -d ${ANDROID_ROOT} +unzip android-sdk.zip -d ${ANDROID_SDK_ROOT} rm -f android-sdk.zip # Install the following SDKs and build tools, passing in "y" to accept licenses. -echo "y" | ${ANDROID_ROOT}/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} \ +echo "y" | ${ANDROID_SDK_ROOT}/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} \ "ndk-bundle" \ "platform-tools" \ "platforms;android-29" \ From f7ce1c8ca3852f59e652e6fbc8ff02f6319e9456 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 11 Mar 2020 13:02:35 +0300 Subject: [PATCH 2/7] Fix android tools installation --- images/linux/scripts/installers/1804/android.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/images/linux/scripts/installers/1804/android.sh b/images/linux/scripts/installers/1804/android.sh index 716f8bb1..c415080d 100644 --- a/images/linux/scripts/installers/1804/android.sh +++ b/images/linux/scripts/installers/1804/android.sh @@ -19,11 +19,11 @@ echo "ANDROID_HOME=${ANDROID_SDK_ROOT}" | tee -a /etc/environment # Download the latest command line tools so that we can accept all of the licenses. # See https://developer.android.com/studio/#command-tools wget -O android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip -unzip android-sdk.zip -d ${ANDROID_ROOT} +unzip android-sdk.zip -d ${ANDROID_SDK_ROOT} rm -f android-sdk.zip # Install the following SDKs and build tools, passing in "y" to accept licenses. -echo "y" | ${ANDROID_ROOT}/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} \ +echo "y" | ${ANDROID_SDK_ROOT}/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} \ "ndk-bundle" \ "platform-tools" \ "platforms;android-29" \ From c985fea383e5a77473d089b5dee4fd1c27de3d85 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Fri, 13 Mar 2020 13:02:25 +0300 Subject: [PATCH 3/7] Add check for sdk manager installation --- images/linux/scripts/installers/1604/android.sh | 13 ++++++++++++- images/linux/scripts/installers/1804/android.sh | 12 +++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/images/linux/scripts/installers/1604/android.sh b/images/linux/scripts/installers/1604/android.sh index c9b4d9d2..8f132114 100644 --- a/images/linux/scripts/installers/1604/android.sh +++ b/images/linux/scripts/installers/1604/android.sh @@ -22,8 +22,19 @@ wget -O android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux unzip android-sdk.zip -d ${ANDROID_SDK_ROOT} rm -f android-sdk.zip +# Check sdk manager installation +${ANDROID_SDK_ROOT}/tools/bin/sdkmanager --list 1>/dev/null +if [ $? -eq 0 ] +then + echo "Android SDK manager was installed" +else + echo "Android SDK manager was not installed" + exit 1 +fi + + # Install the following SDKs and build tools, passing in "y" to accept licenses. -echo "y" | ${ANDROID_SDK_ROOT}/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} \ +echo "y" | ${ANDROID_SDK_ROOT}/tools/bin/sdkmanager \ "ndk-bundle" \ "platform-tools" \ "platforms;android-29" \ diff --git a/images/linux/scripts/installers/1804/android.sh b/images/linux/scripts/installers/1804/android.sh index c415080d..098e9c3c 100644 --- a/images/linux/scripts/installers/1804/android.sh +++ b/images/linux/scripts/installers/1804/android.sh @@ -22,8 +22,18 @@ wget -O android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux unzip android-sdk.zip -d ${ANDROID_SDK_ROOT} rm -f android-sdk.zip +# Check sdk manager installation +${ANDROID_SDK_ROOT}/tools/bin/sdkmanager --list 1>/dev/null +if [ $? -eq 0 ] +then + echo "Android SDK manager was installed" +else + echo "Android SDK manager was not installed" + exit 1 +fi + # Install the following SDKs and build tools, passing in "y" to accept licenses. -echo "y" | ${ANDROID_SDK_ROOT}/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} \ +echo "y" | ${ANDROID_SDK_ROOT}/tools/bin/sdkmanager \ "ndk-bundle" \ "platform-tools" \ "platforms;android-29" \ From 50c81bd62cb9c9e2a007bd6ffef399abe0e24c75 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Fri, 13 Mar 2020 13:26:19 +0300 Subject: [PATCH 4/7] Remove varaible from path --- images/linux/scripts/installers/1604/android.sh | 2 +- images/linux/scripts/installers/1804/android.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/images/linux/scripts/installers/1604/android.sh b/images/linux/scripts/installers/1604/android.sh index 8f132114..0ce3657b 100644 --- a/images/linux/scripts/installers/1604/android.sh +++ b/images/linux/scripts/installers/1604/android.sh @@ -23,7 +23,7 @@ unzip android-sdk.zip -d ${ANDROID_SDK_ROOT} rm -f android-sdk.zip # Check sdk manager installation -${ANDROID_SDK_ROOT}/tools/bin/sdkmanager --list 1>/dev/null +/usr/local/lib/android/tools/bin/sdkmanager --list 1>/dev/null if [ $? -eq 0 ] then echo "Android SDK manager was installed" diff --git a/images/linux/scripts/installers/1804/android.sh b/images/linux/scripts/installers/1804/android.sh index 098e9c3c..042d93e2 100644 --- a/images/linux/scripts/installers/1804/android.sh +++ b/images/linux/scripts/installers/1804/android.sh @@ -23,7 +23,7 @@ unzip android-sdk.zip -d ${ANDROID_SDK_ROOT} rm -f android-sdk.zip # Check sdk manager installation -${ANDROID_SDK_ROOT}/tools/bin/sdkmanager --list 1>/dev/null +/usr/local/lib/android/tools/bin/sdkmanager --list 1>/dev/null if [ $? -eq 0 ] then echo "Android SDK manager was installed" From 4e4275f2f975f9b7480c1b59e71019a76ffbc01a Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Fri, 13 Mar 2020 13:29:28 +0300 Subject: [PATCH 5/7] Fix typo --- images/linux/scripts/installers/1604/android.sh | 2 +- images/linux/scripts/installers/1804/android.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/images/linux/scripts/installers/1604/android.sh b/images/linux/scripts/installers/1604/android.sh index 0ce3657b..490dca0b 100644 --- a/images/linux/scripts/installers/1604/android.sh +++ b/images/linux/scripts/installers/1604/android.sh @@ -23,7 +23,7 @@ unzip android-sdk.zip -d ${ANDROID_SDK_ROOT} rm -f android-sdk.zip # Check sdk manager installation -/usr/local/lib/android/tools/bin/sdkmanager --list 1>/dev/null +/usr/local/lib/android/sdk/tools/bin/sdkmanager --list 1>/dev/null if [ $? -eq 0 ] then echo "Android SDK manager was installed" diff --git a/images/linux/scripts/installers/1804/android.sh b/images/linux/scripts/installers/1804/android.sh index 042d93e2..f712d13a 100644 --- a/images/linux/scripts/installers/1804/android.sh +++ b/images/linux/scripts/installers/1804/android.sh @@ -23,7 +23,7 @@ unzip android-sdk.zip -d ${ANDROID_SDK_ROOT} rm -f android-sdk.zip # Check sdk manager installation -/usr/local/lib/android/tools/bin/sdkmanager --list 1>/dev/null +/usr/local/lib/android/sdk/tools/bin/sdkmanager --list 1>/dev/null if [ $? -eq 0 ] then echo "Android SDK manager was installed" From 936d5e12dcde64fe3c40a328b5144dee97590c0e Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Mon, 16 Mar 2020 09:11:32 +0300 Subject: [PATCH 6/7] Create android sdk directory --- images/linux/scripts/installers/1604/android.sh | 3 +++ images/linux/scripts/installers/1804/android.sh | 3 +++ 2 files changed, 6 insertions(+) diff --git a/images/linux/scripts/installers/1604/android.sh b/images/linux/scripts/installers/1604/android.sh index 490dca0b..7abeb2c1 100644 --- a/images/linux/scripts/installers/1604/android.sh +++ b/images/linux/scripts/installers/1604/android.sh @@ -16,6 +16,9 @@ source $HELPER_SCRIPTS/apt.sh # ANDROID_HOME is deprecated, but older versions of Gradle rely on it echo "ANDROID_HOME=${ANDROID_SDK_ROOT}" | tee -a /etc/environment +# Create android sdk directory +mkdir -p ${ANDROID_SDK_ROOT} + # Download the latest command line tools so that we can accept all of the licenses. # See https://developer.android.com/studio/#command-tools wget -O android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip diff --git a/images/linux/scripts/installers/1804/android.sh b/images/linux/scripts/installers/1804/android.sh index f712d13a..c8ff7baf 100644 --- a/images/linux/scripts/installers/1804/android.sh +++ b/images/linux/scripts/installers/1804/android.sh @@ -16,6 +16,9 @@ echo "ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT}" | tee -a /etc/environment # ANDROID_HOME is deprecated, but older versions of Gradle rely on it echo "ANDROID_HOME=${ANDROID_SDK_ROOT}" | tee -a /etc/environment +# Create android sdk directory +mkdir -p ${ANDROID_SDK_ROOT} + # Download the latest command line tools so that we can accept all of the licenses. # See https://developer.android.com/studio/#command-tools wget -O android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip From 110661eece13dc27a925ca017fb262e104565ee3 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Mon, 16 Mar 2020 09:16:06 +0300 Subject: [PATCH 7/7] Minor fix --- images/linux/scripts/installers/1604/android.sh | 2 ++ images/linux/scripts/installers/1804/android.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/images/linux/scripts/installers/1604/android.sh b/images/linux/scripts/installers/1604/android.sh index 7abeb2c1..43cab549 100644 --- a/images/linux/scripts/installers/1604/android.sh +++ b/images/linux/scripts/installers/1604/android.sh @@ -4,6 +4,8 @@ ## Desc: Installs Android SDK ################################################################################ +set -e + # Source the helpers for use with the script source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/apt.sh diff --git a/images/linux/scripts/installers/1804/android.sh b/images/linux/scripts/installers/1804/android.sh index c8ff7baf..1a1486e3 100644 --- a/images/linux/scripts/installers/1804/android.sh +++ b/images/linux/scripts/installers/1804/android.sh @@ -4,6 +4,8 @@ ## Desc: Installs Android SDK ################################################################################ +set -e + # Source the helpers for use with the script source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/apt.sh