Update to v3.19.0

Last Updated on : 2023-03-09 08:17:40

Tuya SDK has supported AndroidX since v3.19.0.

Google’s supprot library will no longer be updated after v28.0.0. It is recommended that you update to AndroidX.

Migrate to Android X

AndroidX replaces the original support library APIs with packages in the androidx namespace. Only the package and Maven artifact names changed; class, method, and field names did not change.

Note: We recommend working in a separate branch during the migration. Also, try to avoid refactoring your code during the update.

Prerequisites

Before the update, bring your app up to date. We recommend that you migrate your project to use the final version of the support library: version 28.0.0. This is because AndroidX artifacts with version 1.0.0 are binary equivalent to the Support Library 28.0.0 artifacts.

Migrate an existing project using Android Studio

With Android Studio 3.2 and higher, you can migrate an existing project to AndroidX by selecting Refactor > Migrate to AndroidX from the menu bar.

The refactor command makes use of two flags. By default, both of them are set to true in your gradle.properties file:

  • android.useAndroidX=true

    The Android plugin uses the appropriate AndroidX library instead of a Support Library.

  • android.enableJetifier=true

    The Android plugin automatically updates existing third-party libraries to use AndroidX by rewriting their binaries.

Note: The built-in Android Studio update might not handle everything. Depending on your build configuration you may need to update your build scripts and Proguard mappings manually. For example, if you maintain your dependency configuration in a separate build file, use the mapping files mentioned below to review and migrate your dependencies to the corresponding AndroidX packages.

Mappings

If you run into issues with migration, refer to these tables to determine the proper mappings from the support library to the corresponding AndroidX artifacts and classes:

For the latest versions of the Jetpack libraries, see the versions page.

Additional resources

To learn more about migrating your code to AndroidX, see the following additional resources:

Blog posts

Videos

Reference

https://developer.android.google.cn/jetpack/androidx/migrate?hl=en