1
- plugins {
2
- id " com.android.application"
3
- id " kotlin-android"
4
- id " dev.flutter.flutter-gradle-plugin"
5
- }
6
-
7
1
def localProperties = new Properties ()
8
2
def localPropertiesFile = rootProject. file(' local.properties' )
9
3
if (localPropertiesFile. exists()) {
@@ -12,6 +6,11 @@ if (localPropertiesFile.exists()) {
12
6
}
13
7
}
14
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
+
15
14
def flutterVersionCode = localProperties. getProperty(' flutter.versionCode' )
16
15
if (flutterVersionCode == null ) {
17
16
flutterVersionCode = ' 1'
@@ -22,10 +21,12 @@ if (flutterVersionName == null) {
22
21
flutterVersionName = ' 1.0'
23
22
}
24
23
24
+ apply plugin : ' com.android.application'
25
+ apply plugin : ' kotlin-android'
26
+ apply from : " $flutterRoot /packages/flutter_tools/gradle/flutter.gradle"
27
+
25
28
android {
26
- namespace " com.zero.flutter_adcontent_example"
27
29
compileSdkVersion flutter. compileSdkVersion
28
- ndkVersion flutter. ndkVersion
29
30
30
31
compileOptions {
31
32
sourceCompatibility JavaVersion . VERSION_1_8
@@ -35,8 +36,6 @@ android {
35
36
defaultConfig {
36
37
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
37
38
applicationId " com.zero.flutter_adcontent_example"
38
- // You can update the following values to match your application needs.
39
- // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
40
39
minSdkVersion flutter. minSdkVersion
41
40
targetSdkVersion flutter. targetSdkVersion
42
41
versionCode flutterVersionCode. toInteger()
0 commit comments