Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazonアプリストア
Ring
AWS
ドキュメント
Support
Contact Us
My Cases
開発
設計と開発
公開
リファレンス
サポート
メインコンテンツへスキップ
When you first release your app, backward compatibility is not a concern. However, when you update your app to use newer versions of @amazon-devices/ system distributed libraries and resubmit to the Amazon Appstore, the devices that still contain older versions of these libraries won’t be able to install or update to your latest app version.

About system distributed libraries

System distributed libraries are JavaScript packages, always prefixed with @amazon-devices/, that are pre-installed on the device to optimize app size and loading time. As it relates to backward compatibility, the version of each of these libraries is static until the device receives a new flash or OTA update. When a new version of a system distributed library is released (for example, 2.1.0), React Native for Vega maintains compatibility with previous versions (like 2.0.0) within the same major version.

Use the compatibility library

Install compatibility library

Run the following command to install the library:
To declare the range of OS versions your app supports, set min and target in the [os.version] section of your manifest.toml. For details, see Target OS Versions and Manifest [os.version] Section.

Add version checks in code

The isPresentOnOS API helps you verify at runtime whether the required library version is installed on the system, which is especially important when your code depends on specific older versions or needs features that are only available in newer versions.

Testing and verification

Before submitting your app, it’s important to thoroughly test on devices with both older and newer versions of the system distributed libraries that your app uses. Steps to Test
  1. Use Vega to install different simulators: use the CLI to install device simulators on older and newer versions, which will help simulate different real-world scenarios of pre-installed system distributed libraries.
  2. Install the app.
  3. Verify that the app works as expected, paying special attention to any version checks and fallback implementations for older versions, to ensure they are functioning correctly.

Example

Add support for a new feature

The example below shows you how to add support for an imagined withNewBehaviors attribute in DragGesture of @amazon-devices/react-native-gesture-handler. This allows you to switch from the legacy PanGesture implementation, but keep the previous implementation to maintain backward compatibility older library versions.

Troubleshooting

Common issues

A list of common problems and their solutions can be found below.

Version mismatch

  • Problem - The app fails to install on some devices.
  • Solution - Verify that your [os.version].min value in manifest.toml isn’t higher than the OS version on your target devices. For details, see Manifest [os.version] Section.

Runtime errors

  • Problem - Features crash on certain devices.
  • Solution - Ensure you wrap all new feature usage in version checks.

Testing issues

  • Problem - It’s difficult to test across versions.
  • Solution - Use the device simulator to test with different system versions.

Performance best practices with version check

  1. Always check versions as early as possible in your component lifecycle.
  2. Cache version check results to avoid repeated checks.
  3. Consider creating utility functions for commonly checked feature sets, as shown in this example below.

最終更新日 2025年10月30日