Skip to content

Commit a80bb76

Browse files
sudiptachatterjeerami-a
authored andcommitted
Changed android gradle files to make Android X compatible (#174)
1 parent 2fba578 commit a80bb76

File tree

4 files changed

+31
-10
lines changed

4 files changed

+31
-10
lines changed

mdc_100_series/android/app/build.gradle

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,39 @@ if (flutterRoot == null) {
1111
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
1212
}
1313

14+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15+
if (flutterVersionCode == null) {
16+
flutterVersionCode = '1'
17+
}
18+
19+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20+
if (flutterVersionName == null) {
21+
flutterVersionName = '1.0'
22+
}
23+
1424
apply plugin: 'com.android.application'
25+
apply plugin: 'kotlin-android'
1526
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
1627

1728
android {
18-
compileSdkVersion 27
29+
compileSdkVersion 28
30+
31+
sourceSets {
32+
main.java.srcDirs += 'src/main/kotlin'
33+
}
1934

2035
lintOptions {
2136
disable 'InvalidPackage'
2237
}
2338

2439
defaultConfig {
2540
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
26-
applicationId "com.example.mdc100series"
41+
applicationId "com.example.mdc_101_flutter"
2742
minSdkVersion 16
28-
targetSdkVersion 27
29-
versionCode 1
30-
versionName "1.0"
31-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
43+
targetSdkVersion 28
44+
versionCode flutterVersionCode.toInteger()
45+
versionName flutterVersionName
46+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3247
}
3348

3449
buildTypes {
@@ -45,7 +60,8 @@ flutter {
4560
}
4661

4762
dependencies {
63+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
4864
testImplementation 'junit:junit:4.12'
49-
androidTestImplementation 'com.android.support.test:runner:1.0.1'
50-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
65+
androidTestImplementation 'androidx.test:runner:1.1.1'
66+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
5167
}

mdc_100_series/android/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
buildscript {
2+
ext.kotlin_version = '1.3.50'
23
repositories {
34
google()
45
jcenter()
56
}
67

78
dependencies {
8-
classpath 'com.android.tools.build:gradle:3.2.1'
9+
classpath 'com.android.tools.build:gradle:3.5.0'
10+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
911
}
1012
}
1113

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
org.gradle.jvmargs=-Xmx1536M
2+
android.enableR8=true
3+
android.useAndroidX=true
4+
android.enableJetifier=true

mdc_100_series/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip

0 commit comments

Comments
 (0)