Upgrade Guide

Last Updated on : 2025-08-11 09:09:54download

Tuya upgrades SmartLife App SDK and makes the latest version generally available. Based on the optimized business architecture, you can benefit from the neutral software development service and take your unique and proprietary application business to the next level. This topic describes how to upgrade your SDK from a legacy version to v5.x.x or above by using the automatic upgrade script.

Applicability

If your SDK version is 3.x.x or 4.x.x and you need to upgrade to version 5.x.x or above, please follow the steps below to complete the migration.

Procedure

  1. Copy and paste the mapping table thingMapping.json and script thingMapping.gradle to the app module directory.

  2. Choose app > build.gradle and reference the script thingMapping.gradle.

    apply plugin: 'com.android.application'
    // References the script plug-in.
    apply from : "thingMapping.gradle"
    
  3. Open the file thingMapping.gradle, find replaceThing, and then click the green triangle to start automatic modifications.

    Upgrade Guide
  4. Go to Tuya Developer Platform > App SDK > SDK Development > Details page of your SDK-based app > Get SDK, and get the latest key information, including AppKey and AppSecret.

    Upgrade Guide
  5. Replace the key information in your project with the new one. For more information, see Configure AppKey, AppSecret, and certificate signature.

Things to note

  • If you have called non-open SDK methods by using reflection, you need to manually finish the required modifications.
  • If you have called non-API entity classes or methods, you also need to manually finish the required modifications. Alternatively, you can put the name of this type of class or method in the mapping table thingMapping.json and rerun the script to implement automatic modifications.