fix: android build

This commit is contained in:
lollipopkit🏳️‍⚧️
2025-06-08 20:59:58 +08:00
parent 4b3953e0d2
commit 066629d7e0
4 changed files with 21 additions and 6 deletions

View File

@@ -85,13 +85,11 @@ android {
}
debug {
applicationIdSuffix '.debug'
resValue "string", "app_name", "SrvBxD"
// No applicationIdSuffix or resValue here
}
profile {
applicationIdSuffix '.debug'
resValue "string", "app_name", "SrvBxP"
// No applicationIdSuffix or resValue here
}
}
}

View File

@@ -23,7 +23,7 @@
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|hardKeyboardHidden|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|layoutDirection|fontScale|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as

View File

@@ -9,6 +9,23 @@ rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects { subproject ->
// Only works on com.android.application(the main app module)
if (subproject.plugins.hasPlugin('com.android.application')) {
subproject.afterEvaluate {
android.buildTypes.matching { it.name == 'profile' }.all { buildType ->
buildType.applicationIdSuffix = ".profile"
buildTypes.profile.resValue 'string', 'app_name', 'SrvBxP'
}
android.buildTypes.matching { it.name == 'debug' }.all { buildType ->
buildType.applicationIdSuffix = ".debug"
buildTypes.debug.resValue 'string', 'app_name', 'SrvBxD'
}
}
}
}
subprojects {
project.evaluationDependsOn(':app')
}

View File

@@ -20,7 +20,7 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version '8.6.0' apply false
id "org.jetbrains.kotlin.android" version "1.8.10" apply false
id "org.jetbrains.kotlin.android" version "2.1.21" apply false
}
include ":app"