Skip to main content

MIGRATION

Xsolla SDK for Unity - Migrating from 2.x to 3.x

info

Xsolla SDK for Unity is an evolution of the enterprise-level Xsolla SDK solution, designed for integration into large-scale projects.

A step-by-step guide for migrating your Unity project from Xsolla SDK 2.x to Xsolla SDK 3.x, suitable for developers at any experience level.

Prerequisites​

  • Unity 2022.3+ (including Unity 6).
  • Backup your project (e.g., via Git).

1. Remove the Old SDK (2.x)​

1.1 via Unity Package Manager​

  1. Open Packages/manifest.json.
  2. Remove the line:
    "com.xsolla.mobilesdk": "<version>"
    VERSION

    <version> could look something like 2.0.22.

  3. Save the file.

1.2 Manual install (UnityPackage)​

  1. In the Project window, delete:
    Assets/Xsolla.MobileSDK
  2. If present, also remove:
    Packages/com.xsolla.mobilesdk

2. Install the New SDK (3.x)​

Xsolla SDK 3.x is distributed as a .unitypackage or .tar.

Follow the installation guide to install the new SDK version (3.x).

3. Resolve Android Dependencies (Optional)​

After installing the 3.x release, you may want to resolve Android dependencies if you're explicitly targeting Android in your project.

Follow the Android dependency resolving guide to resolve Android dependencies.

info

Xsolla SDK relies on Android AARs; the resolver automatically sets up all required libraries.

4. Update Namespaces and Assembly Definitions​

All namespaces have changed from Xsolla.MobileSDK.* to Xsolla.SDK.*. To update:

  1. In your code editor, open Find and Replace.
  2. Set the search scope to your project folder.
  3. Replace all occurrences, for example:
    - using Xsolla.MobileSDK.Common;
    + using Xsolla.SDK.Common;
  4. Repeat for sub-namespaces: Store, Login, UnityPurchasing, etc.

Assembly Definition files (.asmdef)

If you explicitly referenced Xsolla.MobileSDK in one of your assembly definition files (.asemdef), you will need to update those definitions with Xsolla.SDK now.

5. Updated SDK Configuration​

5.1 Code-based Configuration​

If your project configures the SDK using XsollaClientSettings:

  • Ensure all using directives reference the 3.x namespace:
    - using Xsolla.MobileSDK.Common;
    + using Xsolla.SDK.Common;
  • Instantiate the settings object with the new type:
    var settings = new Xsolla.SDK.Common.XsollaClientSettings(projectId, storeId, accessToken);

5.2 Asset-based Configuration​

If you're using asset-based settings (under the Asset tab) there's no need to take any extra steps as migration of the settings will be automatic.

tip

It's highly recommended to double-check the parameters after migration to assure their correctness.

6. Test & Validate​

  1. Restart Unity to refresh all assets.
  2. Open Window ▶ Package Manager and confirm Xsolla SDK 3.x is installed.
  3. Build your project with the Xsolla SDK 3.x and in case of errors:
    • Make sure you located and updated all of the namespaces.
    • Check whether assembly definitions point at 3.x now and no 2.x entries remain.
    • (Optional) Open the Xsolla SDK settings from the menu and double-check the parameters.
    • (Optional) Verify Android dependencies resolved correctly.

7. Additional Resources​

For further assistance, contact [email protected].