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,36 +12,42 @@ 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. " )
15+ def flutterVersionCode = localProperties. getProperty(' flutter.versionCode ' )
16+ if (flutterVersionCode == null ) {
17+ flutterVersionCode = ' 1 '
1218}
1319
14- apply plugin : ' com.android.application'
15- apply from : " $flutterRoot /packages/flutter_tools/gradle/flutter.gradle"
20+ def flutterVersionName = localProperties. getProperty(' flutter.versionName' )
21+ if (flutterVersionName == null ) {
22+ flutterVersionName = ' 1.0'
23+ }
1624
1725android {
1826 namespace ' com.alternadom.wifiiotexample'
19-
20- compileSdkVersion flutter. compileSdkVersion
27+ compileSdk flutter . compileSdkVersion
28+ ndkVersion flutter. ndkVersion
2129
2230 compileOptions {
2331 sourceCompatibility JavaVersion . VERSION_1_8
2432 targetCompatibility JavaVersion . VERSION_1_8
2533 }
2634
27- lintOptions {
28- disable ' InvalidPackage'
35+ kotlinOptions {
36+ jvmTarget = ' 1.8'
37+ }
38+
39+ sourceSets {
40+ main. java. srcDirs + = ' src/main/kotlin'
2941 }
3042
3143 defaultConfig {
3244 // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
3345 applicationId " com.alternadom.wifiiotexample"
3446 minSdkVersion flutter. minSdkVersion
3547 targetSdkVersion flutter. targetSdkVersion
36- versionCode 1
37- versionName " 1.0 "
38- testInstrumentationRunner ' androidx.test.runner.AndroidJUnitRunner '
48+ targetSdkVersion flutter . targetSdkVersion
49+ versionCode flutterVersionCode . toInteger()
50+ versionName flutterVersionName
3951 }
4052
4153 buildTypes {
@@ -51,8 +63,12 @@ flutter {
5163 source ' ../..'
5264}
5365
66+
67+
5468dependencies {
5569 testImplementation ' junit:junit:4.12'
5670 androidTestImplementation ' androidx.test.ext:junit:1.1.1'
5771 androidTestImplementation ' androidx.test.espresso:espresso-core:3.1.0'
5872}
73+
74+
0 commit comments