Develop

Meta VR OS SDK versioning

Updated: Sep 14, 2026

Build for multiple Horizon OS releases

Use Meta VR OS SDK versioning to support your app across multiple Horizon OS releases. Declare its minimum and target SDK versions, then query and compare the SDK API version available on the device to choose version-specific behavior.

Version numbering in Meta VR OS SDK and Horizon OS

Each release of the Meta VR OS SDK is assigned an integer version number, such as 207. This value is conceptually equivalent to Android’s API level⁠, but Meta VR OS SDK version numbers are independent of the API level of the Android Open Source Project (AOSP) version upon which Horizon OS is based. This value increases with each release that is not a patch to a previously released version. Version numbers may be skipped.
Like Android’s API level, this Meta VR OS SDK version number is intended for reference by developers targeting Horizon OS. You can query it from the Meta VR OS Java Software Development Kit (JSDK) and Native Software Development Kit (NSDK), and a utility API for comparing against this version number is available in the Meta VR OS Utility Library.
A separate, user-facing version string for Horizon OS is visible to users via user interfaces on Meta VR devices and on other software such as the Meta Horizon mobile app, the Meta Horizon Link app, and the Meta Quest Developer Hub. This user-facing Horizon OS version uses semantic versioning, such as 2.1. Although this value can be queried via the Meta VR OS SDK, do not reference it for the purposes described in this guide. This API should only be used for situations where the user-facing version number of Horizon OS is relevant, such as in your app’s telemetry. See API reference documentation for more information.

Versioning in your package’s manifest

The uses-metavr-sdk element

Horizon OS supports an XML element, uses-metavr-sdk, for inclusion in your application’s AndroidManifest.xml file. Similar to the Android uses-sdk element⁠, including this element in your application increases your application’s stability and compatibility across Horizon OS versions.
For now, including this element in your app’s manifest is optional.
Note: Horizon OS and the Meta Horizon Developer Dashboard still accept the older uses-horizonos-sdk element, so applications that declared it keep working. Use uses-metavr-sdk for new work.

Adding the uses-metavr-sdk element to your manifest

The uses-metavr-sdk manifest element lets you control your package’s distribution and Horizon OS behavior related to your package.
To add this element to your package, make two changes in your AndroidManifest.xml file:
  1. Within the root <manifest> element, add the following XML namespace attribute: xmlns:metavr="http://schemas.meta.com/metavr-sdk".
  2. Within the <manifest> element, add the <uses-metavr-sdk> element and specify values for the minSdkVersion and targetSdkVersion attributes.
Here’s an example of what your updated manifest should look like.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:tools="http://schemas.android.com/tools"
   xmlns:metavr="http://schemas.meta.com/metavr-sdk">

   <metavr:uses-metavr-sdk
       metavr:minSdkVersion="123"
       metavr:targetSdkVersion="456" />
...
In addition to this general guidance, consult the documentation for the specific SDKs your application uses.

The minSdkVersion attribute

The minSdkVersion attribute specifies the minimum Meta VR OS SDK version that your application is compatible with.
When Horizon OS installs a package, the package’s specified minSdkVersion is compared to the Meta VR OS SDK version available on the OS. If minSdkVersion is greater than the Meta VR OS SDK version present, installation is blocked. Additionally, the package may be filtered out of Store searches or other user interfaces on devices running a version of Horizon OS with which the app is not compatible.

Choosing a minSdkVersion

To select an appropriate minSdkVersion, evaluate which Meta VR OS SDK version your application is compatible with, and which Horizon OS versions you intend to support.
Consider the following:
  • What is the first Meta VR OS SDK version that contains all APIs your application depends on?
  • Does your application depend on components, such as libraries, that have their own minSdkVersion requirements?
  • Across what range of Horizon OS versions do you intend to support your users?
While you’ll need to choose the value that best fits your application, common approaches include:
  • Set minSdkVersion to the Meta VR OS SDK version used in development, both in your project and on your device. This ensures your application will not run on older Horizon OS versions (which you did not develop on).
  • Set minSdkVersion to the first Meta VR OS SDK version containing all APIs used directly by your application. This enables targeting a wider range of Horizon OS versions while ensuring your application does not invoke APIs that do not exist on the running OS version.
  • Set minSdkVersion to the lowest Meta VR OS SDK version you can support, even though older versions lack some APIs your application references. At runtime, invoke only APIs available in the Meta VR OS SDK version reported by the version query APIs. This approach maximizes compatibility with older Horizon OS versions.

The targetSdkVersion attribute

The targetSdkVersion attribute specifies the Meta VR OS SDK version your application targets.
Horizon OS behavior evolves with each release. To maximize compatibility with existing applications, wherever possible, changes to OS behavior apply only to clients built to be compatible with those new behaviors. For clients targeting older SDK versions, compatibility behaviors consistent with the specified targetSdkVersion are executed instead.

Choosing a targetSdkVersion

To select targetSdkVersion, evaluate which Horizon OS behavior version your application prefers and which Meta VR OS SDK version your application was tested against.
For most applications, update targetSdkVersion frequently to take advantage of the latest Horizon OS advances. In rare cases, an older targetSdkVersion is preferred, such as when your application depends on legacy Horizon OS behavior that no longer works the same way in more recent SDK versions.

Adjusting your application’s behavior at runtime

To support multiple Meta VR OS SDK versions simultaneously, query the Meta VR OS SDK version available at runtime and adjust your application’s behavior accordingly. APIs for querying the available Meta VR OS SDK version are available through the Meta VR OS JSDK and NSDK. A related utility API in the Meta VR OS Utility Library is also provided (see Handling versioning with the Meta VR OS Utility Library).
This is optional. It is not relevant if your application targets a single Meta VR OS SDK version, such as the most recent one. However, if you want to target multiple Meta VR OS SDK versions, this mechanism maximizes compatibility.
For example, if an API your application requires has been deprecated and replaced with a new API, your application should invoke the new API on Horizon OS versions that support it and fall back to the deprecated API otherwise.
Similarly, if Horizon OS behavior has evolved in a way that affects your application, your application should include behaviors that are compatible with the old and new Horizon OS behavior, and select the correct behavior at runtime based on the Meta VR OS SDK version.
The following pseudocode demonstrates a typical pattern for supporting both a deprecated API and its replacement when supporting Horizon OS versions before and after the replacement API was introduced.
int first_sdk_version_with_new_api = ...

if get_metavr_os_sdk_version() < first_sdk_version_with_new_api
then call_deprecated_api()
else call_new_api()

Handling versioning with the Meta VR OS Utility Library

An alternative to direct integration with Meta VR OS JSDK APIs is to use the Meta VR OS Utility Library. This will ensure your code is backwards compatible and in the best position to receive updates should the calling patterns evolve. The Meta VR OS Utility Library is currently only available for clients capable of calling Java APIs (for example, Java and Kotlin).

Get the library

The Meta VR OS Utility Library is distributed through Maven Central and can be added to your Gradle build like other dependencies of this type:
dependencies {
  implementation("com.meta.metavrx.util:util:1.0.0")
}
The Meta VR OS Utility Library can coexist in a project alongside other Meta VR OS SDK packages.

Perform the check

Once the Meta VR OS Utility Library has been added as a dependency, you can use the MetaVrOsSdkVersion.isAtOrAbove() method to determine the Horizon OS version on which your app is running.
import metavrx.os.MetaVrOsSdkVersion

if (MetaVrOsSdkVersion.isAtOrAbove(207)) {
  // execute code that only works on Horizon OS version 207 or later
} else {
  // fall back to default behavior if APIs are not available
}

Java is a registered trademark of Oracle and/or its affiliates.