From 6419c8742b5fa6df0f12a11e1a1554cb34168538 Mon Sep 17 00:00:00 2001 From: Ely Ronnen Date: Tue, 24 Oct 2023 17:52:12 +0300 Subject: [PATCH] fix android sdkmanager invocation (#582) Fix "java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema" error caused by invoking the wrongf sdkmanager script --- dist/platforms/ubuntu/steps/build.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dist/platforms/ubuntu/steps/build.sh b/dist/platforms/ubuntu/steps/build.sh index a066e4ed2..7a202babb 100755 --- a/dist/platforms/ubuntu/steps/build.sh +++ b/dist/platforms/ubuntu/steps/build.sh @@ -69,7 +69,15 @@ fi if [[ "$BUILD_TARGET" == "Android" && -n "$ANDROID_SDK_MANAGER_PARAMETERS" ]]; then echo "Updating Android SDK with parameters: $ANDROID_SDK_MANAGER_PARAMETERS" export JAVA_HOME="$(awk -F'=' '/JAVA_HOME=/{print $2}' /usr/bin/unity-editor.d/*)" - "$(awk -F'=' '/ANDROID_HOME=/{print $2}' /usr/bin/unity-editor.d/*)/tools/bin/sdkmanager" "$ANDROID_SDK_MANAGER_PARAMETERS" + ANDROID_HOME_DIRECTORY="$(awk -F'=' '/ANDROID_HOME=/{print $2}' /usr/bin/unity-editor.d/*)" + SDKMANAGER=$(find $ANDROID_HOME_DIRECTORY/cmdline-tools -name sdkmanager) + if [ -z "${SDKMANAGER}" ] + then + echo "No sdkmanager found" + exit 1 + fi + + $SDKMANAGER "$ANDROID_SDK_MANAGER_PARAMETERS" echo "Updated Android SDK." else echo "Not updating Android SDK."