Skip to content

Commit e8f5dfa

Browse files
authored
chore(samples): upgrade android gradle plugin and dependencies (#2375)
1 parent 62e2956 commit e8f5dfa

File tree

10 files changed

+260
-110
lines changed

10 files changed

+260
-110
lines changed
Lines changed: 17 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,34 @@
11
plugins {
22
id "com.android.application"
3+
// START: FlutterFire Configuration
4+
id "com.google.gms.google-services"
5+
// END: FlutterFire Configuration
36
id "kotlin-android"
7+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
48
id "dev.flutter.flutter-gradle-plugin"
59
}
610

7-
def localProperties = new Properties()
8-
def localPropertiesFile = rootProject.file('local.properties')
9-
if (localPropertiesFile.exists()) {
10-
localPropertiesFile.withReader('UTF-8') { reader ->
11-
localProperties.load(reader)
12-
}
13-
}
14-
15-
16-
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
17-
if (flutterVersionCode == null) {
18-
flutterVersionCode = '1'
19-
}
20-
21-
def flutterVersionName = localProperties.getProperty('flutter.versionName')
22-
if (flutterVersionName == null) {
23-
flutterVersionName = '1.0'
24-
}
25-
2611
android {
2712
namespace "io.getstream.chat.android.flutter.sample"
13+
compileSdkVersion flutter.compileSdkVersion
14+
ndkVersion "27.0.12077973"
2815

29-
compileSdkVersion 35
30-
31-
ndkVersion "26.2.11394342"
32-
33-
sourceSets {
34-
main.java.srcDirs += 'src/main/kotlin'
16+
compileOptions {
17+
sourceCompatibility JavaVersion.VERSION_11
18+
targetCompatibility JavaVersion.VERSION_11
19+
coreLibraryDesugaringEnabled true
3520
}
3621

37-
lintOptions {
38-
disable 'InvalidPackage'
39-
checkReleaseBuilds false
22+
kotlinOptions {
23+
jvmTarget = JavaVersion.VERSION_11.toString()
4024
}
4125

4226
defaultConfig {
4327
applicationId "io.getstream.chat.android.flutter.sample"
44-
minSdkVersion 23
45-
targetSdkVersion 35
46-
versionCode flutterVersionCode.toInteger()
47-
versionName flutterVersionName
48-
multiDexEnabled true
49-
}
50-
51-
compileOptions {
52-
// Flag to enable support for the new language APIs
53-
coreLibraryDesugaringEnabled true
54-
}
55-
56-
// Added this block:
57-
afterEvaluate { project ->
58-
if (project.hasProperty("kotlin")) {
59-
project.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
60-
kotlinOptions {
61-
jvmTarget = "1.8"
62-
}
63-
}
64-
}
28+
minSdkVersion Math.max(flutter.minSdkVersion, 23)
29+
targetSdkVersion flutter.targetSdkVersion
30+
versionCode flutter.versionCode
31+
versionName flutter.versionName
6532
}
6633

6734
signingConfigs {
@@ -93,5 +60,5 @@ flutter {
9360
}
9461

9562
dependencies {
96-
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
63+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
9764
}

0 commit comments

Comments
 (0)