Version
UE4.27.2, Android Studio4.0, Windows system
Error content
Unable to locate sdkmanager.bat. Did you run Android Studio and install cmdline-tools after installing?
Solution
1) Check whether the Android SDK and NDK are configured according to the official documentation.
URL: Setting Up the Unreal Android SDK and NDK | Unreal Engine Documentation (unrealengine.com)
2) If the installation directory is not the default location of Android Studio, an error is reported because the corresponding directory cannot be found, or the environment variable STUDIO_SDK_PATH is wrong.
1. Find the installation directory of UE4.27, enter UE_4.27 \ Engine \ Extras \ Android in turn, there is a SetupAndroid.bat file in the directory, it is recommended to copy and backup first.
2. Right-click SetupAndroid.bat, edit,
Find the line set SDKMANAGER=%STUDIO_SDK_PATH%\tools\bin\sdkmanager.bat, which is the path of SDKManager.
3. Find the location of your own sdkmanager.bat, usually in the installed SDK directory \ cmdline-tools \ latest \ bin \ sdkmanager.bat, copy the absolute path of the file, overwrite the path after set SDKMANAGER=, save, and test . For example: set SDKMANAGER=D:\work\AndroidSDK\SDK\cmdline-tools\latest\bin\sdkmanager.bat