UE 5.8 Android SDK Turnkey installation fails with SetupAndroid.bat Exit Code 4

Summary

Hi,

I’m having trouble getting the Android SDK setup working through Turnkey in UE 5.8.

When I go to Platforms → SDK Management → Android → Install SDK, Turnkey starts the installation normally and detects the SDK requirements. However, it eventually fails when it runs SetupAndroid.bat.

What Type of Bug are you experiencing?

Platform Mobile

Steps to Reproduce

The fastest way is to create a new AR Template project. Then:

  1. Go to Platforms > SDK Management > Android > Install or Install Sdk (full Platform Installer)
  2. Wait for installer to finish

Expected Result

I would expect Unreal Engine to detect the installed Android SDK components and complete the Android SDK setup successfully.

Observed Result

The installer will not finish. It will ask if you want to retry, but however many times retry will fail. When I click not want to retry, i will get Installation Failed

Affects Versions

5.8

Platform(s)

Android

Upload an image

Additional Notes

I was able to get past the error by creating a separate .bat file to install and configure the required Android components. But i have no idea how to pass it to you. You can get it from here :

Hope it helps