Skip to content

Commit 74aa2ae

Browse files
committed
Upgrade android plugins.
1 parent 6244864 commit 74aa2ae

6 files changed

Lines changed: 24 additions & 34 deletions

File tree

android/app/build.gradle

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,15 @@ if (localPropertiesFile.exists()) {
1212
}
1313
}
1414

15-
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
16-
if (flutterVersionCode == null) {
17-
flutterVersionCode = '1'
18-
}
19-
20-
def flutterVersionName = localProperties.getProperty('flutter.versionName')
21-
if (flutterVersionName == null) {
22-
flutterVersionName = '1.0'
23-
}
24-
2515
def keystoreProperties = new Properties()
2616
def keystorePropertiesFile = rootProject.file('key.properties')
2717
if (keystorePropertiesFile.exists()) {
2818
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
2919
}
3020

3121
android {
32-
compileSdkVersion 36
22+
compileSdkVersion flutter.compileSdkVersion
23+
ndkVersion flutter.ndkVersion
3324

3425
sourceSets {
3526
main.java.srcDirs += 'src/main/kotlin'
@@ -42,15 +33,13 @@ android {
4233
kotlinOptions {
4334
jvmTarget = 17
4435
}
45-
ndkVersion = flutter.ndkVersion
46-
4736

4837
defaultConfig {
4938
applicationId "com.unicornsonlsd.finamp"
5039
minSdkVersion flutter.minSdkVersion
51-
targetSdkVersion 35
52-
versionCode flutterVersionCode.toInteger()
53-
versionName flutterVersionName
40+
targetSdkVersion flutter.targetSdkVersion
41+
versionCode flutter.versionCode
42+
versionName flutter.versionName
5443
}
5544
signingConfigs {
5645
release {
@@ -77,8 +66,10 @@ android {
7766
// minifyEnabled false
7867
}
7968
profile {
80-
// https://github.com/flutter/flutter/issues/169215
81-
// applicationIdSuffix '.profile'
69+
if (signingConfigs.hasProperty('profile')) {
70+
signingConfig signingConfigs.profile
71+
}
72+
applicationIdSuffix '.profile'
8273
// minifyEnabled true // avoid dexing issues
8374
resValue "string", "app_name", "Finamp Profile"
8475
}
@@ -102,8 +93,8 @@ flutter {
10293
}
10394

10495
dependencies {
105-
implementation 'androidx.appcompat:appcompat:1.3.1'
106-
implementation 'androidx.mediarouter:mediarouter:1.7.0'
107-
implementation "androidx.core:core-splashscreen:1.0.0"
108-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1"
96+
implementation 'androidx.appcompat:appcompat:1.7.1'
97+
implementation 'androidx.mediarouter:mediarouter:1.8.1'
98+
implementation "androidx.core:core-splashscreen:1.2.0"
99+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2"
109100
}

android/app/src/main/kotlin/com/unicornsonlsd/finamp/MainActivity.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.unicornsonlsd.finamp
22

33
import android.app.UiModeManager
4-
import android.content.Context
54
import android.content.Intent
65
import android.os.Bundle
76
import android.provider.Settings
@@ -71,7 +70,7 @@ class MainActivity : AudioServiceActivity() {
7170
when (call.method) {
7271
"setNativeThemeMode" -> {
7372
val uiManager: UiModeManager =
74-
getApplicationContext().getSystemService(Context.UI_MODE_SERVICE) as UiModeManager
73+
applicationContext.getSystemService(UI_MODE_SERVICE) as UiModeManager
7574

7675
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
7776
// Only api >= 31 supports uiManager.setApplicationNightMode

android/build.gradle

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@ allprojects {
55
}
66
}
77

8-
rootProject.buildDir = '../build'
8+
def rootBuildDir = rootProject.layout.buildDirectory.get().dir('../../build')
9+
rootProject.layout.buildDirectory.value(rootBuildDir)
910
subprojects {
10-
project.buildDir = "${rootProject.buildDir}/${project.name}"
11+
def subProjectBuildDir = rootBuildDir.dir(project.name)
12+
project.layout.buildDirectory.value(subProjectBuildDir)
1113
}
1214
subprojects {
1315
afterEvaluate { project ->
1416
if (project.plugins.hasPlugin("com.android.application") ||
1517
project.plugins.hasPlugin("com.android.library")) {
1618
project.android {
17-
compileSdkVersion 36
18-
buildToolsVersion "34.0.0"
19+
compileSdkVersion flutter.compileSdkVersion
20+
buildToolsVersion "36.0.0"
1921
}
2022
}
2123
}
@@ -25,5 +27,5 @@ subprojects {
2527
}
2628

2729
tasks.register("clean", Delete) {
28-
delete rootProject.buildDir
30+
delete rootProject.layout.buildDirectory
2931
}

android/gradle.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
22
android.useAndroidX=true
3-
android.enableJetifier=true
4-
android.defaults.buildfeatures.buildconfig=true
53
android.nonTransitiveRClass=false
64
android.nonFinalResIds=false

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

android/settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ pluginManagement {
1919

2020
plugins {
2121
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
22-
id "com.android.application" version '8.9.2' apply false
23-
id "org.jetbrains.kotlin.android" version "2.2.10" apply false
22+
id "com.android.application" version '8.13.2' apply false
23+
id "org.jetbrains.kotlin.android" version "2.3.21" apply false
2424
}
2525

2626
include ":app"

0 commit comments

Comments
 (0)