Nutrient 3.2 migration guide
This guide covers migrating to version 3.2 of Nutrient Flutter SDK. It outlines how to compile the SDK version upgrade and how to upgrade Gradle.
Compiling the SDK version upgrade
Nutrient Flutter SDK 3.2 on Android requires a minimum compileSdkVersion
of 31. When you upgrade to Nutrient 3.2, your Android build might fail if your android
module’s compileSdkVersion
is below 31.
To change compileSdkVersion
for 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:
android {
...
compileSdkVersion 31
...
}
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 thecompileSdkVersion
property. See our example Catalog for more detail.
Gradle upgrade (recommended)
It’s recommended that you upgrade your version of Gradle, but this is optional. To upgrade, make the following changes:
In your_project_folder/android/build.gradle
, change your Gradle version to 7.1.1:
dependencies { classpath('com.android.tools.build:gradle:7.1.1') }
Then, update your_project_folder/android/gradle/wrapper/gradle-wrapper.properties
:
distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists - distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-all.zip + distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrappe
Alternatively, you can open the android
module of your project in the current stable Android Studio version 2021.1.1, and Android Studio will suggest an automatic Gradle update using AGP Upgrade Assistant.