Last Updated on : 2024-11-18 11:33:17
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.
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.
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.
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.
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.
To learn more about migrating your code to AndroidX, see the following additional resources:
https://developer.android.google.cn/jetpack/androidx/migrate?hl=en
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback