I know this works for both 4.26.2 (for Oculus Quest 2) and for 4.27.2 (for Android). I know that the document states to use the Android Studio from 2020 and the script, but that did not work for me. I had a custom setup on different drives on different platforms and I used Android Studio for a co-current install for Unity. Install the following.
SDK- 29.0.3
NDK- 21.4.7075529
OpenJDK - 13.0.2
SDK API level - android-29
NDK API level - android-29
For the SDK/NDK install the latest version of Android Studio (or whatever version you prefer/currently using).
Open the SDK Manager from the main screen.
Take note of the Android SDK Location path, as that will determine where the downloaded software goes as well as where to point the UE SDK paths. Also note that with the above configuration, it shouldn’t matter what other NDKs/SDKs are downloaded, however if you run into issues, just clear out the other versions as a process of elimination. Also ensure that the Command Line tools are present per the documentation.
Also click Show Package Details in the lower right. This will allow to select the individual Build Tools and NDKs.
In the Build tools
Check the box next to 29.0.3, it will queue for downloading.
Navigate down to NDK (side-by-side) and check the box next to 21.4.707.5529, it to will queue for downloading.
Click Apply and the software will download and install in the Android SDK Location.
JDK 13 can be obtained at OpenJDK archive
Download the zip, and you can drop it in the 'C:\Program Files\Java' folder or wherever, in the Java folder will require admin rights.
Inside of UE. Got to Edit > Project Settings > Android SDK.
The SDK path is the SDK Location, that can be copy and pasted.
The NDK is a subfolder in the NDK location, \ndk\21.4.7075529
The JDK path is the root folder of the OpenJDK download from above.
SDK and NDK API levels are both android-29.
Packaging should work (I only tested with ASTC). Hope this helps!