1- plugins {
2- id " com.android.application"
3- id " kotlin-android"
4- id " dev.flutter.flutter-gradle-plugin"
5- }
6-
71def localProperties = new Properties ()
82def localPropertiesFile = rootProject. file(' local.properties' )
93if (localPropertiesFile. exists()) {
@@ -12,6 +6,11 @@ if (localPropertiesFile.exists()) {
126 }
137}
148
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+
1514def flutterVersionCode = localProperties. getProperty(' flutter.versionCode' )
1615if (flutterVersionCode == null ) {
1716 flutterVersionCode = ' 1'
@@ -22,8 +21,11 @@ if (flutterVersionName == null) {
2221 flutterVersionName = ' 1.0'
2322}
2423
24+ apply plugin : ' com.android.application'
25+ apply plugin : ' kotlin-android'
26+ apply from : " $flutterRoot /packages/flutter_tools/gradle/flutter.gradle"
27+
2528android {
26- namespace = " com.example.example"
2729 compileSdkVersion flutter. compileSdkVersion
2830 ndkVersion flutter. ndkVersion
2931
@@ -45,7 +47,7 @@ android {
4547 applicationId " com.example.example"
4648 // You can update the following values to match your application needs.
4749 // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
48- minSdkVersion flutter . minSdkVersion
50+ minSdkVersion 23
4951 targetSdkVersion flutter. targetSdkVersion
5052 versionCode flutterVersionCode. toInteger()
5153 versionName flutterVersionName
@@ -65,4 +67,5 @@ flutter {
6567}
6668
6769dependencies {
70+ implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version "
6871}
0 commit comments