1
- def localProperties = new Properties ()
2
- def localPropertiesFile = rootProject. file(' local.properties' )
3
- if (localPropertiesFile. exists()) {
4
- localPropertiesFile. withReader(' UTF-8' ) { reader ->
5
- localProperties. load(reader)
6
- }
1
+ plugins {
2
+ id ' com.android.application'
3
+ id ' kotlin-android'
4
+ // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5
+ id ' dev.flutter.flutter-gradle-plugin'
7
6
}
8
7
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
- def flutterVersionCode = localProperties. getProperty(' flutter.versionCode' )
15
- if (flutterVersionCode == null ) {
16
- flutterVersionCode = ' 1'
17
- }
18
8
19
- def flutterVersionName = localProperties. getProperty(' flutter.versionName' )
20
- if (flutterVersionName == null ) {
21
- flutterVersionName = ' 1.0'
9
+ def localProperties = new Properties ()
10
+ def localPropertiesFile = rootProject. file(' local.properties' )
11
+ if (localPropertiesFile. exists()) {
12
+ localProperties. load(new FileInputStream (localPropertiesFile))
22
13
}
23
14
24
- apply plugin : ' com.android.application'
25
- apply plugin : ' kotlin-android'
26
- apply from : " $flutterRoot /packages/flutter_tools/gradle/flutter.gradle"
27
-
28
15
android {
29
16
compileSdkVersion flutter. compileSdkVersion
17
+ namespace = ' com.ionicfirebaseapp.getwidget_example'
30
18
31
19
compileOptions {
32
- sourceCompatibility JavaVersion . VERSION_1_8
33
- targetCompatibility JavaVersion . VERSION_1_8
20
+ sourceCompatibility JavaVersion . VERSION_21
21
+ targetCompatibility JavaVersion . VERSION_21
34
22
}
35
23
36
24
kotlinOptions {
37
- jvmTarget = ' 1.8 '
25
+ jvmTarget = ' 21 '
38
26
}
39
27
40
28
sourceSets {
@@ -48,8 +36,8 @@ android {
48
36
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
49
37
minSdkVersion 21
50
38
targetSdkVersion flutter. targetSdkVersion
51
- versionCode flutterVersionCode . toInteger()
52
- versionName flutterVersionName
39
+ versionCode = flutter . versionCode
40
+ versionName = flutter . versionName
53
41
}
54
42
55
43
buildTypes {
@@ -64,7 +52,3 @@ android {
64
52
flutter {
65
53
source ' ../..'
66
54
}
67
-
68
- dependencies {
69
- implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version "
70
- }
0 commit comments