perf(android): trim platform assets and release Dart symbols

This commit is contained in:
zarzet committed 2026-10-06 21:58:55 +07:00
1 parent b8c50b1527
commit f61e815e24
3 files changed
+17 -2

No files matched your search

+4 -2
View File
@@ -84,8 +84,10 @@ installation must be regenerated with that setting.
Android release builds, including plain `flutter build apk --release`, keep Dart
debug data in `build/symbols/android/app.<architecture>.symbols` to reduce APK
size without obfuscation. An explicit `--split-debug-info` path overrides this
default; `--analyze-size` retains Flutter's normal behavior. Keep these symbols
size. The release script also uses `--obfuscate` to shorten internal Dart names;
when building directly, add `--obfuscate --split-debug-info=build/symbols/android`
for the smaller APK. An explicit `--split-debug-info` path overrides the default;
plain `--analyze-size` builds retain Flutter's normal behavior. Keep these symbols
with the matching APK before another local build replaces them. Decode a trace
with `flutter symbolize --debug-info=<symbols-file> --input=crash.txt`.
+11
View File
@@ -173,6 +173,17 @@ val buildRustBackend = tasks.register<Exec>("buildRustBackend") {
}
tasks.named("preBuild").configure { dependsOn(buildRustBackend) }
// Filter Android's copy only; keep shared bundles and mobile glass shaders intact.
tasks.withType<org.gradle.api.tasks.Copy>().configureEach {
if (name.startsWith("copyFlutterAssets")) {
exclude(
"flutter_assets/packages/liquid_glass_easy/lib/assets/shaders/liquid_glass_desktop.frag",
"flutter_assets/packages/liquid_glass_easy/lib/assets/shaders/metaball_glass_desktop.frag",
"flutter_assets/packages/flutter_local_notifications_web/web/notifications_service_worker.js",
)
}
}
flutter {
source = "../.."
}
+2
View File
@@ -94,6 +94,8 @@ fi
BUILD_GIT_COMMIT="$(git rev-parse --short=8 HEAD)"
"${FLUTTER_COMMAND[@]}" build apk \
--release \
--obfuscate \
--split-debug-info "$PROJECT_DIR/build/symbols/android" \
--split-per-abi \
--target-platform "$TARGET_PLATFORM_LIST" \
--dart-define="GIT_COMMIT=$BUILD_GIT_COMMIT" \