1+ plugins {
2+ id " com.android.application"
3+ id " kotlin-android"
4+ id " dev.flutter.flutter-gradle-plugin"
5+ }
6+
17def localProperties = new Properties ()
28def localPropertiesFile = rootProject. file(' local.properties' )
39if (localPropertiesFile. exists()) {
@@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
612 }
713}
814
9- def flutterRoot = localProperties. getProperty(' flutter.sdk' )
10- if (flutterRoot == null ) {
11- throw new GradleException (" Flutter SDK not found. Define location with flutter.sdk in the local.properties file." )
12- }
13-
1415def flutterVersionCode = localProperties. getProperty(' flutter.versionCode' )
1516if (flutterVersionCode == null ) {
1617 flutterVersionCode = ' 1'
@@ -21,12 +22,14 @@ if (flutterVersionName == null) {
2122 flutterVersionName = ' 1.0'
2223}
2324
24- apply plugin : ' com.android.application'
25- apply plugin : ' kotlin-android'
26- apply from : " $flutterRoot /packages/flutter_tools/gradle/flutter.gradle"
27-
2825android {
29- compileSdkVersion 31
26+
27+ // Conditional for compatibility with AGP <4.2.
28+ if (project. android. hasProperty(" namespace" )) {
29+ namespace ' com.simform.example'
30+ }
31+
32+ compileSdk 35
3033
3134 sourceSets {
3235 main. java. srcDirs + = ' src/main/kotlin'
@@ -39,7 +42,7 @@ android {
3942 defaultConfig {
4043 // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4144 applicationId " com.simform.example"
42- minSdkVersion 16
45+ minSdkVersion flutter . minSdkVersion
4346 targetSdkVersion 31
4447 versionCode flutterVersionCode. toInteger()
4548 versionName flutterVersionName
@@ -60,7 +63,6 @@ flutter {
6063}
6164
6265dependencies {
63- implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version "
6466 testImplementation ' junit:junit:4.12'
6567 androidTestImplementation ' com.android.support.test:runner:1.0.2'
6668 androidTestImplementation ' com.android.support.test.espresso:espresso-core:3.0.2'
0 commit comments