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
- }
7
- }
8
-
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
1
19
- def flutterVersionName = localProperties. getProperty(' flutter.versionName' )
20
- if (flutterVersionName == null ) {
21
- flutterVersionName = ' 1.0'
2
+ plugins {
3
+ id " com.android.application"
4
+ id " kotlin-android"
5
+ // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
6
+ id " dev.flutter.flutter-gradle-plugin"
22
7
}
23
8
24
- apply plugin : ' com.android.application'
25
- apply plugin : ' kotlin-android'
26
- apply from : " $flutterRoot /packages/flutter_tools/gradle/flutter.gradle"
27
-
28
9
android {
29
- compileSdkVersion flutter. compileSdkVersion
30
- ndkVersion flutter. ndkVersion
10
+ namespace = " io.bdk.f.bdk_flutter_example"
11
+ compileSdk = flutter. compileSdkVersion
12
+ ndkVersion " 25.1.8937393"
31
13
32
14
compileOptions {
33
- sourceCompatibility JavaVersion . VERSION_1_8
34
- targetCompatibility JavaVersion . VERSION_1_8
15
+ sourceCompatibility JavaVersion . VERSION_17
16
+ targetCompatibility JavaVersion . VERSION_17
35
17
}
36
-
37
18
kotlinOptions {
38
- jvmTarget = ' 1.8 '
19
+ jvmTarget = JavaVersion . VERSION_17
39
20
}
40
21
41
- sourceSets {
42
- main. java. srcDirs + = ' src/main/kotlin'
43
- }
22
+
44
23
45
24
defaultConfig {
46
25
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47
26
applicationId " io.bdk.f.bdk_flutter_example"
48
27
// You can update the following values to match your application needs.
49
28
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
50
- minSdkVersion 23
51
- targetSdkVersion flutter. targetSdkVersion
52
- versionCode flutterVersionCode . toInteger()
53
- versionName flutterVersionName
29
+ minSdk = 23
30
+ targetSdk = flutter. targetSdkVersion
31
+ versionCode = flutter . versionCode
32
+ versionName = flutter . versionName
54
33
}
55
34
56
35
buildTypes {
@@ -60,13 +39,9 @@ android {
60
39
signingConfig signingConfigs. debug
61
40
}
62
41
}
63
- namespace ' io.bdk.f.bdk_flutter_example'
64
42
}
65
43
66
44
flutter {
67
45
source ' ../..'
68
46
}
69
47
70
- dependencies {
71
- implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version "
72
- }
0 commit comments