This guide details the recommended editor versions, graphics settings, URP settings, and Android project settings when developing a Unity application for Android XR.
Prerequisites
To develop with Unity you will need to Download and install Unity Hub.
Install version 6000.0.23f1 or higher of the Unity Editor and Android Build Support, which includes:
- OpenJDK
- Android SDK
- Android NDK Tools
Select a rendering engine
We recommend using the Vulkan Graphics API to render Android XR apps. To select Vulkan as your Graphics API, follow these steps:
- In Unity, go to Edit > Project Settings > Player.
- Select the Android tab and navigate to Other Settings > Rendering.
- If Auto Graphics API is enabled, disable this setting to reveal the Graphics APIs section.
In the Graphics APIs section, select the Add (+) button and select Vulkan from the dropdown.
Re-order the Graphics APIs using the handles (=) so that Vulkan is listed first.
Optionally, select any other Graphics APIs and click the Remove (-) button to remove them.
Universal Render Pipeline
Android XR is compatible with the Universal Render Pipeline (URP). If you plan to use passthrough, you should update the default URP settings for best passthrough performance on Android XR.
The following table has a list of Unity's recommended URP settings, which are explained in greater detail in the following sections.
Setting |
Location |
Recommended value |
---|---|---|
HDR |
Universal Render Pipeline Asset |
Disabled |
Post-processing |
Universal Renderer Data |
Disabled |
Universal Render Pipeline Asset settings
Follow these steps to optimize your Universal Render Pipeline Asset for Android XR:
Locate your project's Universal Render Pipeline Asset. One way to do this is to type
t:UniversalRenderPipelineAsset
into the Project window's search bar.Under the Quality header, disable HDR.
Universal Renderer Data settings
Follow these steps to optimize your Universal Renderer Data for Android XR:
Locate your project's Universal Renderer Data Asset. One way to do this is to type
t:UniversalRendererData
into the Project window's search bar.In the Inspector, under the Post-processing header, uncheck Enabled.
Minimal Android API level
Set your project to a minimal API level of 24, which is required by the OpenXR Loader. Otherwise, your builds may fail.
Complete these steps to set the minimal Android API level.
- Go to Edit > Project Settings > Player.
- Select the Android tab and open Other Settings.
- In the Identification section, for Minimal API level, select 24 or higher.
Application entry point
Configure the following settings for application entry point:
- Go to Edit > Project Settings > Player.
- Select the Android tab and open Other Settings.
- In the Application Entry Point section, make sure the GameActivity is checked and Activity is unchecked.
Pop-up windows
Most Android XR apps require resizable windows, as they are required to render pop-ups such as system permission requests.
Follow these steps to ensure pop-up windows are rendered properly.
- Go to Edit > Project Settings > Player.
- Select the Android tab and enable Resizeable Activity.