1def localProperties = new Properties() 2def localPropertiesFile = rootProject.file('local.properties') 3if (localPropertiesFile.exists()) { 4 localPropertiesFile.withReader('UTF-8') { reader -> 5 localProperties.load(reader) 6 } 7} 8 9def flutterRoot = localProperties.getProperty('flutter.sdk') 10if (flutterRoot == null) { 11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12} 13 14def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15if (flutterVersionCode == null) { 16 flutterVersionCode = '1' 17} 18 19def flutterVersionName = localProperties.getProperty('flutter.versionName') 20if (flutterVersionName == null) { 21 flutterVersionName = '1.0' 22} 23 24apply plugin: 'com.android.application' 25apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 27android { 28 compileSdkVersion 28 29 30 lintOptions { 31 disable 'InvalidPackage' 32 } 33 34 defaultConfig { 35 applicationId "io.flutter.examples.platform_channel" 36 minSdkVersion 16 37 targetSdkVersion 28 38 versionCode flutterVersionCode.toInteger() 39 versionName flutterVersionName 40 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 41 } 42 43 buildTypes { 44 release { 45 // TODO: Add your own signing config for the release build. 46 // Signing with the debug keys for now, so `flutter run --release` works. 47 signingConfig signingConfigs.debug 48 } 49 } 50} 51 52flutter { 53 source '../..' 54} 55 56dependencies { 57 testImplementation 'junit:junit:4.12' 58 androidTestImplementation 'com.android.support.test:runner:1.0.2' 59 androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 60} 61