Created
March 1, 2026 16:31
-
-
Save foriequal0/5a450bbb39d260957ddc81f8e83c2afd to your computer and use it in GitHub Desktop.
Fix Unity3d Android Build Support's NDK path symlink
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| UNITY_HUB_EDITOR=${1:-$HOME/Unity/Hub/Editor} | |
| pushd "$UNITY_HUB_EDITOR" > /dev/null | |
| for UNITY in *; do | |
| echo "Checking: $UNITY" | |
| CLANGPP="./$UNITY/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++" | |
| if ! [ -f "$CLANGPP" ]; then | |
| echo " Android Build Support is not installed" | |
| continue | |
| fi | |
| LINKED_TO=$(readlink "$CLANGPP") | |
| NDK_VERSION=$(sed -nE 's/^.*\/NDK\/(.*)\/toolchains\/.*$/\1/p' <<<"$LINKED_TO") | |
| echo " NDK version detected: $NDK_VERSION" | |
| pushd "./$UNITY/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/" > /dev/null | |
| echo " Making symlink" | |
| ln -s ./ "./$NDK_VERSION" | |
| popd > /dev/null | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment