Skip to content

Commit

Permalink
fix android sdkmanager invocation (#582)
Browse files Browse the repository at this point in the history
Fix "java.lang.NoClassDefFoundError:
javax/xml/bind/annotation/XmlSchema" error caused by invoking the wrongf
sdkmanager script
  • Loading branch information
eronnen authored Oct 24, 2023
1 parent a13443a commit 6419c87
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion dist/platforms/ubuntu/steps/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 6419c87

Please sign in to comment.