Skip to content

Commit 86b741e

Browse files
committed
Upgrade Android SDK, other dependencies and AGP apply syntax
1 parent 6340c0d commit 86b741e

File tree

8 files changed

+109
-109
lines changed

8 files changed

+109
-109
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,6 @@ app.*.map.json
4747

4848
/android/build/
4949
.gradle/
50+
51+
# Should be able to remove this once Flutter 3.29 bug has been resolved
52+
example/android/app/.cxx/

android/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
}
88

99
dependencies {
10-
classpath 'com.android.tools.build:gradle:8.1.4'
10+
classpath 'com.android.tools.build:gradle:8.10.0'
1111
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1212
}
1313
}
@@ -33,7 +33,7 @@ apply plugin: 'com.google.devtools.ksp'
3333
android {
3434
namespace "com.keevault.flutter_autofill_service"
3535

36-
compileSdk 34
36+
compileSdk 35
3737

3838
sourceSets {
3939
main.java.srcDirs += 'src/main/kotlin'
@@ -60,16 +60,16 @@ dependencies {
6060
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
6161

6262
implementation 'androidx.autofill:autofill:1.1.0'
63-
implementation "androidx.annotation:annotation:1.8.2"
63+
implementation "androidx.annotation:annotation:1.9.1"
6464
implementation 'androidx.appcompat:appcompat:1.7.0'
65-
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
65+
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
6666
implementation 'com.google.android.material:material:1.12.0'
6767
implementation 'io.github.oshai:kotlin-logging-jvm:5.1.0'
6868
implementation 'org.tinylog:tinylog-api:2.6.2'
6969
implementation 'org.tinylog:tinylog-impl:2.6.2'
7070
implementation 'org.tinylog:slf4j-tinylog:2.6.2'
7171

72-
implementation 'androidx.core:core-ktx:1.13.1'
72+
implementation 'androidx.core:core-ktx:1.16.0'
7373

7474
// json deserialize
7575
implementation "com.squareup.moshi:moshi:1.14.0"

example/android/app/build.gradle

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
17
def localProperties = new Properties()
28
def localPropertiesFile = rootProject.file('local.properties')
39
if (localPropertiesFile.exists()) {
@@ -6,11 +12,6 @@ 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.")
12-
}
13-
1415
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1516
if (flutterVersionCode == null) {
1617
flutterVersionCode = '1'
@@ -21,12 +22,8 @@ if (flutterVersionName == null) {
2122
flutterVersionName = '1.0'
2223
}
2324

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
2825
android {
29-
compileSdk 34
26+
compileSdk 35
3027

3128
sourceSets {
3229
main.java.srcDirs += 'src/main/kotlin'
@@ -36,7 +33,7 @@ android {
3633
defaultConfig {
3734
applicationId "com.keevault.flutter_autofill_service_example"
3835
minSdkVersion 29
39-
targetSdk 34
36+
targetSdk 35
4037
versionCode flutterVersionCode.toInteger()
4138
versionName flutterVersionName
4239
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -69,14 +66,12 @@ flutter {
6966
}
7067

7168
dependencies {
72-
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
73-
//implementation "uk.uuid.slf4j:slf4j-android:1.7.30-0"
7469
implementation 'org.tinylog:tinylog-api:2.6.2'
7570
implementation 'org.tinylog:tinylog-impl:2.6.2'
7671
implementation 'org.tinylog:slf4j-tinylog:2.6.2'
7772
implementation 'androidx.appcompat:appcompat:1.7.0'
78-
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
73+
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
7974
testImplementation 'junit:junit:4.13.2'
80-
androidTestImplementation 'androidx.test:runner:1.6.1'
75+
androidTestImplementation 'androidx.test:runner:1.6.2'
8176
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
8277
}

example/android/build.gradle

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
buildscript {
2-
ext {
3-
agp_version = '8.5.0'
4-
}
5-
ext.kotlin_version = '2.1.21'
6-
repositories {
7-
google()
8-
mavenCentral()
9-
}
10-
11-
dependencies {
12-
classpath "com.android.tools.build:gradle:$agp_version"
13-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14-
}
15-
}
16-
171
allprojects {
182
repositories {
193
google()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Wed Mar 02 19:04:58 GMT 2022
22
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists
66
zipStoreBase=GRADLE_USER_HOME

example/android/settings.gradle

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
1-
include ':app'
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}()
29

3-
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
411

5-
def plugins = new Properties()
6-
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7-
if (pluginsFile.exists()) {
8-
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
917
}
1018

11-
plugins.each { name, path ->
12-
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13-
include ":$name"
14-
project(":$name").projectDir = pluginDirectory
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0" // apply true
21+
id "com.android.application" version "8.10.0" apply false
22+
id "org.jetbrains.kotlin.android" version "2.1.21" apply false
1523
}
24+
25+
include ":app"

0 commit comments

Comments
 (0)