---
source_path: "upgrade.md"
canonical_url: "https://doc.sensory.com/tnl/7.8/upgrade/"
---

# How to upgrade

The TrulyHandsfree and TrulyNatural SDKs are fully backwards-compatible with application
code and models from earlier releases.

To upgrade to a new version or variant (for example from TrulyHandsfree to TrulyNatural),
replace the library files and rebuild your application.

## C applications

Use these steps for all applications that link against `libsnsr.a`.
This includes those that use other application languages via an adapter, such as [iOS](https://doc.sensory.com/tnl/7.8/api/build-system.md#build-ios).

1. Replace both `libsnsr.a` and `snsr.h` with their updated versions.
      - Find `libsnsr.a` appropriate for your target platform in the _~/Sensory/TrulyNaturalSDK/7.9.0-pre.0/lib/_ directory, and
        `snsr.h` in _~/Sensory/TrulyNaturalSDK/7.9.0-pre.0/include/_
      - [new](https://doc.sensory.com/tnl/7.8/api/inference.md#new) does a runtime check to verify that the library and its header are in sync;
        if they're not, it will return the [LIBRARY_HEADER](https://doc.sensory.com/tnl/7.8/api/inference.md#rc) error code.
      - For iOS, update the [XCFramework][] from _~/Sensory/TrulyNaturalSDK/7.9.0-pre.0/lib/ios/snsr.xcframework_
2. If you are using [custom library initialization](https://doc.sensory.com/tnl/7.8/faq.md#reduce-code-size) you must recreate
   `snsr-custom-init.c` using [snsr-edit](https://doc.sensory.com/tnl/7.8/tools/snsr-edit.md#snsr-edit) from the new SDK version.
3. Rebuild your application.

## Android and Java applications

If you're using the recommended [Android build recipe](https://doc.sensory.com/tnl/7.8/api/build-system.md#build-android):

1. Edit `gradle.properties` and update `SNSR_REPOSITORY`, `SNSR_LIB_VERSION`,
   and possibly `SNSR_LIB_TYPE`.
      - The SDK installers publish the library artifacts in `mavenLocal()` too.
        If you're using these, there's no need to update `SNSR_REPOSITORY`.
2. Rebuild your application.

<!-- Reference definitions from includes/links.md -->
[XCFramework]: https://developer.apple.com/documentation/xcode/creating-a-multi-platform-binary-framework-bundle

<!-- Abbreviation definitions from includes/abbreviations.md -->
*[API]: Application Programming Interface
*[SDK]: Software Development Kit
*[TNL]: TrulyNatural, Sensory's large-vocabulary speech recognition technology
