XR Runtime

Start your custom AR or 3D session with our native runtime.
Latest Update Stable Release Release Candidate Beta Release Alpha Release
May 7, 2025 - - - 1.0.0-alpha04

Declaring dependencies

To add a dependency on XR runtime, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.

Add the dependencies for the artifacts you need in the build.gradle file for your app or module:

Groovy

dependencies {
    implementation "androidx.xr.runtime:runtime:1.0.0-alpha04"

    // Use in environments that do not support OpenXR
    testImplementation "androidx.xr.runtime:runtime-testing:1.0.0-alpha04"
}

Kotlin

dependencies {
    implementation("androidx.xr.runtime:runtime:1.0.0-alpha04")

    // Use in environments that do not support OpenXR
    testImplementation("androidx.xr.runtime:runtime-testing:1.0.0-alpha04")
}

For more information about dependencies, see Add build dependencies.

Feedback

Your feedback helps make Jetpack better. Let us know if you discover new issues or have ideas for improving this library. Please take a look at the existing issues in this library before you create a new one. You can add your vote to an existing issue by clicking the star button.

Create a new issue

See the Issue Tracker documentation for more information.

Version 1.0

Version 1.0.0-alpha04

May 7, 2025

androidx.xr.runtime:runtime:1.0.0-alpha04, androidx.xr.runtime:runtime-openxr:1.0.0-alpha04, and androidx.xr.runtime:runtime-testing:1.0.0-alpha04 are released. Version 1.0.0-alpha04 contains these commits.

New Features

  • Session now implements androidx.lifecycle.LifecycleOwner for more interoperability with existing Android lifecycle paradigms.
  • Manifest strings for Android XR are specified and documented here.
  • Spatial Visibility Callback extension methods added to monitor when the scene content moves inside or outside the user's field of view.
  • Added a stub version of the JxrPlatformAdapter (and all its related classes).
  • Session will be used in both SceneCore and Runtime instead of the Session in SceneCore.
  • ActivityPose.hitTest was added, enabling a hitTest against virtual content.
  • Specifying multiple Runtime implementations at compile time is now supported. Only one will be loaded at execution time based on the current device's feature set.
  • Added new Component type SpatialPointerComponent, allowing clients to specify the icon rendered for the pointer, or to disable the icon. This Component can currently be attached to PanelEntity instances only.

API Changes

  • Make Config implementation public. (I95860)
  • Add HandJointType and TrackingState. (I55880)
  • Projects released with Kotlin 2.0 require KGP 2.0.0 or newer to be consumed (Idb6b5)
  • Hand.isActive (boolean) has been changed to Hand.trackingState. The OpenXR implementation has been modified accordingly.
  • android.permission.SCENE_UNDERSTANDING permission requirement in Session.configure has been changed to android.permission.SCENE_UNDERSTANDING_COARSE.
  • LifecycleManager.configure is implemented and now passes in a Config object which contains a property for each configurable runtime feature.
  • Session.configure can now be called with a Config in order to configure the available runtime features.
  • Session.create now supports passing a CoroutineContext instead of a CoroutineDispatcher.
  • Session.create supports loading ARCore for Jetpack XR and/or SceneCore. At least one must be provided (testing versions are available).
  • FakePerceptionManager throws an AnchorInvalidUuidException when an invalid UUID is passed to Anchor.load and Anchor.unpersist.
  • CoreState is no longer a data class.

Bug Fixes

  • Fixed Runtime proguard configurations.

Version 1.0.0-alpha03

February 26, 2025

androidx.xr.runtime:runtime:1.0.0-alpha03, androidx.xr.runtime:runtime-openxr:1.0.0-alpha03, and androidx.xr.runtime:runtime-testing:1.0.0-alpha03 are released with no notable changes since the last alpha. Version 1.0.0-alpha03 contains these commits.

Version 1.0.0-alpha02

February 12, 2025

androidx.xr.runtime:runtime:1.0.0-alpha02, androidx.xr.runtime:runtime-openxr:1.0.0-alpha02, and androidx.xr.runtime:runtime-testing:1.0.0-alpha02 are released. Version 1.0.0-alpha02 contains these commits.

Breaking & behavioral changes

  • OpenXR runtime functions that return an Anchor now throw AnchorResourcesExhaustedException if they encounter an error code notifying that the OpenXR resource limit has been reached.
  • Permission android.permission.HAND_TRACKING is now required for Session.create and Session.resume.

New features

  • Added hand tracking support.

Bug fixes

  • Creating anchors is more stable when running on an emulator

Version 1.0.0-alpha01

December 12, 2024

androidx.xr.runtime:runtime-* 1.0.0-alpha01 is released.

Features of Initial Release

Initial release of Jetpack XR Runtime. This library contains fundamental pieces of functionality for the Jetpack XR suite of libraries. This includes capability discovery, lifecycle management, configuration, and more. The Runtime library provides different variations (e.g. runtime-openxr or runtime-testing) depending on the execution platform. Additionally, this library offers fundamental math abstractions such as Vector3 and Matrix4 that are used across the entire Jetpack XR API surface.

  • Session: Provides you with fine-grained controls over the XR system, including deciding when processing is and is not being executed and the overall configuration. It is also the handle that you will use across all other APIs to unlock the underlying system capabilities.

  • Pose: A location in an arbitrary coordinate system that has a position and orientation associated with it. You will use this class to communicate the location of objects with ARCore for Jetpack XR and Jetpack SceneCore.

Known Issues

  • configure is currently a no-op. Future releases will add new settings that you can use to control the behavior of the Session.