Problem
PR #225 restored green CI after the Flutter/Dart maintenance pass and re-enabled enforced APK size gates for the lean Android variants. However, the full Android app APK remains too large for production release readiness.
Latest CI size report from PR #225:
| Variant |
Artifact |
Size |
Gate |
Status |
mobile-streaming |
app-arm64-v8a-release.apk |
30.82 MiB |
35 MiB |
Passing |
tv |
app-arm64-v8a-release.apk |
27.60 MiB |
35 MiB |
Passing |
mobile-full |
app-arm64-v8a-release.apk |
439.92 MiB |
report-only |
Too large |
The full app APK is dominated by native libraries:
mobile-full / app-arm64-v8a-release.apk breakdown
native libraries: 427.10 MiB
dex: 16.69 MiB
assets: 6.51 MiB
resources: 0.88 MiB
PR #225 intentionally made the full-app size check report-only so CI can stay green while lean variants remain protected. This issue tracks the follow-up work needed before treating the full app as production-release ready.
Context
Related PR: #225
PR #225 already completed:
- Upgraded CI to Flutter
3.41.4 / Dart 3.11.1.
- Fixed app analyzer/codegen blockers.
- Added CI-only Android release signing.
- Normalized arm64 APK output for size validation.
- Added
build_runner clean before CI codegen.
- Added
pdfx stub for lean variants.
- Excluded LiteRT native
.so files from streaming/TV APK packaging based on APP_VARIANT.
- Restored passing lean APK gates:
- Streaming:
30.82 MiB
- TV:
27.60 MiB
The remaining production concern is the full app native AI footprint, especially LiteRT / on-device AI artifacts.
Scope
In scope:
- Measure exactly which native libraries account for the
427.10 MiB full-app native footprint.
- Decide whether full-app on-device AI should be bundled, downloaded on demand, split by flavor, or delivered through Play Feature Delivery / dynamic feature modules.
- Implement the selected production packaging strategy.
- Restore an enforced full-app size gate or create a documented production-specific gate if
35 MiB is no longer the correct target.
- Update CI, release docs, and any rollout notes.
Out of scope:
Suggested Investigation Plan
- Generate a full release APK or AAB size breakdown using Android Studio APK Analyzer,
apkanalyzer, or CI artifact inspection.
- Identify all large
.so files and their source Maven/package dependency.
- Compare options:
- Keep bundled and set a realistic full-app budget.
- Move LiteRT/model runtime behind download-on-demand.
- Split AI into a dedicated flavor or dynamic feature module.
- Use Play Asset Delivery / Play Feature Delivery if suitable.
- Validate install/startup behavior on target Android devices, especially Pixel 9 / on-device AI paths.
- Update CI so the selected production artifact is enforced, not only reported.
Acceptance Criteria
Validation Commands / Checks
Use these as a baseline, adapting as needed for the selected packaging strategy:
cd app
flutter pub get
dart run build_runner clean
dart run build_runner build --delete-conflicting-outputs
flutter analyze --no-fatal-infos --no-fatal-warnings
flutter test --reporter=compact
flutter build apk --release \
--target=lib/main.dart \
--target-platform=android-arm64 \
--dart-define=APP_VARIANT=full \
--dart-define=APP_PLATFORM=mobileFull \
--tree-shake-icons \
--split-debug-info=build/debug-info-mobile-full \
--obfuscate
CI checks to keep green:
- Continuous Integration / analyze
- Continuous Integration / lint
- Continuous Integration / test-core
- Continuous Integration / build-android matrix
- PR Checks / tests
- PR Checks / code-quality
- Security scan / Trivy
- Snyk
- SonarCloud
- Plugin Size Gate
Agent / Ownership
Primary agent: agent/performance
Supporting agents:
agent/ci-cd for CI gates and release workflow.
agent/ai-llm for on-device AI packaging decisions.
agent/release for production artifact policy and release readiness.
Priority / Estimate
Priority: priority/P1
Estimate: 2-4 engineering days depending on whether the solution is CI budget re-baselining, dynamic delivery, or runtime download-on-demand.
Risks
- A naive size-gate increase could mask a poor production install experience.
- Removing bundled AI libraries could break Gemini Nano / LiteRT runtime paths if not feature-gated correctly.
- Dynamic delivery or download-on-demand changes can affect offline behavior and first-use latency.
- Release artifact choice may differ between GitHub APK validation and Play Store AAB distribution; document this explicitly.
Problem
PR #225 restored green CI after the Flutter/Dart maintenance pass and re-enabled enforced APK size gates for the lean Android variants. However, the full Android app APK remains too large for production release readiness.
Latest CI size report from PR #225:
mobile-streamingapp-arm64-v8a-release.apk30.82 MiB35 MiBtvapp-arm64-v8a-release.apk27.60 MiB35 MiBmobile-fullapp-arm64-v8a-release.apk439.92 MiBThe full app APK is dominated by native libraries:
PR #225 intentionally made the full-app size check report-only so CI can stay green while lean variants remain protected. This issue tracks the follow-up work needed before treating the full app as production-release ready.
Context
Related PR: #225
PR #225 already completed:
3.41.4/ Dart3.11.1.build_runner cleanbefore CI codegen.pdfxstub for lean variants..sofiles from streaming/TV APK packaging based onAPP_VARIANT.30.82 MiB27.60 MiBThe remaining production concern is the full app native AI footprint, especially LiteRT / on-device AI artifacts.
Scope
In scope:
427.10 MiBfull-app native footprint.35 MiBis no longer the correct target.Out of scope:
Suggested Investigation Plan
apkanalyzer, or CI artifact inspection..sofiles and their source Maven/package dependency.Acceptance Criteria
35 MiB.flutter analyze --no-fatal-infos --no-fatal-warningspasses.Validation Commands / Checks
Use these as a baseline, adapting as needed for the selected packaging strategy:
CI checks to keep green:
Agent / Ownership
Primary agent:
agent/performanceSupporting agents:
agent/ci-cdfor CI gates and release workflow.agent/ai-llmfor on-device AI packaging decisions.agent/releasefor production artifact policy and release readiness.Priority / Estimate
Priority:
priority/P1Estimate: 2-4 engineering days depending on whether the solution is CI budget re-baselining, dynamic delivery, or runtime download-on-demand.
Risks