Nutrient Flutter SDK support for projects using Android Gradle Plugin 7

Nutrient Flutter SDK supports projects that use Android Gradle Plugin (AGP) 8.* and above. If your project uses AGP 7.*, make the following changes to the project’s Gradle settings file to use Nutrient Flutter SDK.

  1. Open the project’s Gradle settings file, android/settings.gradle:

open android/settings.gradle
  1. Update the pluginManagement block in the android/settings.gradle file as follows:

pluginManagement {
	...
+    buildscript {
+        repositories {
+            mavenCentral()
+            maven {
+                url = uri("https://storage.googleapis.com/r8-releases/raw")
+            }
+        }
+        dependencies {
+            classpath("com.android.tools:r8:8.3.37")
+       }
+    }
}

// Upgrade Kotlin version.
plugins {
	id "dev.flutter.flutter-plugin-loader" version "1.0.0"
	id "com.android.application" version "7.3.0" apply false
-   id "org.jetbrains.kotlin.android" version "1.7.10" apply false
+   id "org.jetbrains.kotlin.android" version "1.8.22" apply false
}

This step involves enabling R8 for code shrinking (not required for AGP 8.* and above) and upgrading the Kotlin version.