---
title: "Nutrient 2.8 migration guide"
canonical_url: "https://www.nutrient.io/guides/react-native/migration-guides/react-native-2-8-migration-guide/"
md_url: "https://www.nutrient.io/guides/react-native/migration-guides/react-native-2-8-migration-guide.md"
last_updated: "2026-05-23T00:08:18.147Z"
description: "Migration guide for Nutrient React Native SDK version 2.8 with breaking changes, API updates, and upgrade instructions."
---

This guide covers migrating to [Nutrient React Native SDK 2.8](https://www.nutrient.io/blog/pspdfkit-react-native-2-8-typescript-support/), which requires changes to move to Gradle 8.

### Initializing the Nutrient plugin

Customers who are using their application in production and have already set their license keys aren’t affected by this change.

Nutrient React Native SDK 2.8 now requires you to initialize the Nutrient plugin, even when running in trial mode. The plugin is initialized by calling either the `setLicenseKey` or `setLicenseKeys` API when your application starts. In your main `.ts` or `.js` file, add the following above your class declaration:

```js

import { NativeModules } from 'react-native';...
const PSPDFKit = NativeModules.PSPDFKit;
PSPDFKit.setLicenseKey(null);

```

### iOS CocoaPods dependencies

Nutrient now specifies the iOS versions of the `PSPDFKit` and `Instant` SDKs as part of the plugin source code, and it no longer needs to be set in your application `Podfile`.

If present, remove the `PSPDFKit` and `Instant` entries from `ios/Podfile`:

```diff

-  pod "PSPDFKit", podspec: "https://my.nutrient.io/pspdfkit-ios/latest.podspec"

-  pod "Instant", podspec: "https://my.nutrient.io/instant/latest.podspec"

```

Next, delete `Podfile.lock` and run `pod install` from within your project’s `ios` directory:

```sh

pod install

```

### Bumping the Android compileSdkVersion

To continue to bring our customers the latest features offered by our native SDKs, we depend on the latest Nutrient Android SDK. When you upgrade to Nutrient React Native SDK 2.8, your application’s `compileSdkVersion` needs to be set to a minimum of `34`.

To change the `compileSdkVersion` of your Android module, open your module’s app-level Gradle file in `your_project_folder/android/app/build.gradle`, and set `compileSdkVersion` as shown below:

```kotlin

android {...
    compileSdkVersion 34...
}

```

Some projects may be using Gradle extra properties (`ext`) to store the version number in a separate `.gradle` file. In this case, update the value of the `compileSdkVersion` property. Refer to our [example Catalog] for more details.

### Upgrade Gradle

The Nutrient Android SDK, on which the React Native plugin depends, requires your Gradle version to be upgraded to 8. Even though the newly released React Native 0.73 also requires Gradle 8, some React Native dependencies aren’t yet supported. Check the various dependency home pages to ensure you’re running a version that supports Gradle 8. To upgrade, make the changes outlined below.

In `your_project_folder/android/build.gradle`, change your Gradle version to 8.1.0:

```kotlin

dependencies {
  classpath('com.android.tools.build:gradle:8.1.0')
}

```

Then, update `your_project_folder/android/gradle/wrapper/gradle-wrapper.properties`:

```diff

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists

- distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip

+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

```

Alternatively, you can open the `android` module of your project in the current stable Android Studio, and Android Studio will suggest an automatic Gradle update using [AGP Upgrade Assistant](https://developer.android.com/studio/build/agp-upgrade-assistant).

After upgrading to Gradle 8, you’ll be required to update your JDK version to Java 17, which is [supported by Gradle 8](https://gradle.org/whats-new/gradle-8/#ecosystem-support-upgrades/). After downloading and installing the Java 17 JDK, ensure your `JAVA_HOME` environment variable in your `~/.zshrc` or `~/.bash_profile` is configured to point to the new JDK location.
---

## Related pages

- [React Native 2 12 Migration Guide](/guides/react-native/migration-guides/react-native-2-12-migration-guide.md)
- [React Native 2 2 Migration Guide](/guides/react-native/migration-guides/react-native-2-2-migration-guide.md)
- [React Native 2 16 Migration Guide](/guides/react-native/migration-guides/react-native-2-16-migration-guide.md)
- [React Native 2 9 Migration Guide](/guides/react-native/migration-guides/react-native-2-9-migration-guide.md)
- [React Native 2 3 Migration Guide](/guides/react-native/migration-guides/react-native-2-3-migration-guide.md)
- [React Native 2 13 Migration Guide](/guides/react-native/migration-guides/react-native-2-13-migration-guide.md)
- [React Native 3 Migration Guide](/guides/react-native/migration-guides/react-native-3-migration-guide.md)
- [How to upgrade to the latest React Native version](/guides/react-native/migration-guides/upgrading.md)
- [React Native 4 Migration Guide](/guides/react-native/migration-guides/react-native-4-migration-guide.md)

