1
+ plugins {
2
+ id " com.android.application"
3
+ id " kotlin-android"
4
+ id " dev.flutter.flutter-gradle-plugin"
5
+ }
6
+
1
7
def localProperties = new Properties ()
2
8
def localPropertiesFile = rootProject. file(' local.properties' )
3
9
if (localPropertiesFile. exists()) {
@@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
6
12
}
7
13
}
8
14
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
-
14
15
def flutterVersionCode = localProperties. getProperty(' flutter.versionCode' )
15
16
if (flutterVersionCode == null ) {
16
17
flutterVersionCode = ' 1'
@@ -21,12 +22,20 @@ if (flutterVersionName == null) {
21
22
flutterVersionName = ' 1.0'
22
23
}
23
24
24
- apply plugin : ' com.android.application'
25
- apply plugin : ' kotlin-android'
26
- apply from : " $flutterRoot /packages/flutter_tools/gradle/flutter.gradle"
27
-
28
25
android {
29
- compileSdkVersion 30
26
+ namespace " com.example.example"
27
+ defaultConfig {
28
+ compileSdk flutter. compileSdkVersion
29
+ }
30
+
31
+ compileOptions {
32
+ sourceCompatibility JavaVersion . VERSION_1_8
33
+ targetCompatibility JavaVersion . VERSION_1_8
34
+ }
35
+
36
+ kotlinOptions {
37
+ jvmTarget = ' 1.8'
38
+ }
30
39
31
40
sourceSets {
32
41
main. java. srcDirs + = ' src/main/kotlin'
@@ -35,8 +44,8 @@ android {
35
44
defaultConfig {
36
45
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
37
46
applicationId " com.example.example"
38
- minSdkVersion 16
39
- targetSdkVersion 30
47
+ minSdkVersion flutter . minSdkVersion
48
+ targetSdkVersion flutter . targetSdkVersion
40
49
versionCode flutterVersionCode. toInteger()
41
50
versionName flutterVersionName
42
51
}
@@ -54,6 +63,4 @@ flutter {
54
63
source ' ../..'
55
64
}
56
65
57
- dependencies {
58
- implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version "
59
- }
66
+ dependencies {}
0 commit comments