[SOLVED] SDK, NDK, and JDK configuration for compiling Android (including Oculus Quest 2) for 26.2 and 27.2

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!

11 Likes

Hi! I am having a similar issue, but my issue is Unreal says only SDK version r25b is allowed, but I need to run the earlier version to install to my Quest. So I can package the game with SDK r25b, but the apk runs into an error, or I try to package with an earlier version of SDK and the packaging fails. Would you be able to help me with this?

1 Like


These are the settings that worked for me, if anyone is struggling!

2 Likes

Thx so much! Was really struggling to get 5.1 working. Your steps worked 1st time out! You’re a wizard.

2 Likes

Whoever wrote out the original post is the wizard, but you’re welcome!

Great, it worked for me. I had been trying for about 4 days to package the game.

Hi should i be using andriod version 32 for quest, after june 2023 ?

Hi @shammi.seth this doc should be kept up to date. Just be sure to select the correct engine version in the upper-left.

Still does not mention JDK version. i had to go down to version 11.

Sorry guys. This was from 2022 and was a fix for 4.2(6-7) well before the Google API requirement. For 5.X. I found that the Turnkey solution with JDK 17 in the JAVA PATH solves my issues (for both Quest 2 and Mobile). I will create a separate thread with that so that people can find it separately with key words.

1 Like

Hey any update on this? I’ve been trying for days to package the template VR project for Oculus Quest 2 - anyone have a latest update on the stack required? Can anyone be a hero and provide screenshots? I’m running a windows 10

someone mentioned earlier about JDK 13.0.2 - from OpenJDK - are you saying that this didn’t work? And you had to use JDK 11? (I’m trying to package on UE5.3 for Quest 2)

this works perfectly great, but i need the api 33 now. how to do that?

1 Like

Worked, Thanks

thanks man

I have been facing these errors LogPlayLevel: Error: UAT: ERROR: Failed to find %ANDROID_HOME%/build-tools subdirectory. Run SDK manager and install build-tools.
PackagingResults: Error: Launch failed! Android build-tools directory not found

run the setupandroid bat in *:\Unreal-Engines\UE_5.0\Engine\Extras\Android