perf(android): APK size reduction phase 1#2
Conversation
…ions - Split release APK per ABI (arm64 + x64 only), dropping universal fat build - Enable R8 minification and resource shrinking for release builds - Exclude Vulkan debug validation layer from release packaging - Exclude unused MediaPipe image generation libs from release packaging
📝 WalkthroughWalkthroughThe release build process has been updated to generate ABI-specific APKs for ARM64 and x64 architectures rather than a single universal APK. Additionally, code minification and resource shrinking have been enabled in the Android release build configuration, with specific native libraries excluded from packaging. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/release.yml (1)
40-45: Consider adding error handling for the APK rename loop.If the build fails silently or produces unexpected output, the glob
app-*-release.apkwon't match any files, and bash will iterate with the literal string, causing a confusingmverror.🛠️ Suggested improvement with error handling
- name: Rename APKs with version run: | cd build/app/outputs/flutter-apk + shopt -s nullglob + apks=(app-*-release.apk) + if [ ${`#apks`[@]} -eq 0 ]; then + echo "Error: No APKs found matching app-*-release.apk" + exit 1 + fi for apk in app-*-release.apk; do mv "$apk" "koshika-${{ github.ref_name }}-${apk#app-}" done🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/release.yml around lines 40 - 45, The rename loop can run with the literal glob when no APKs exist; modify the step so you first expand the pattern into an array (files=(app-*-release.apk)) or enable nullglob (shopt -s nullglob) and then check if the array is empty before the for loop; if empty, emit an error message and exit non-zero, otherwise iterate over the array (for apk in "${files[@]}") and run mv "koshika-${{ github.ref_name }}-${apk#app-}" only for real files to avoid spurious mv errors.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/release.yml:
- Around line 40-45: The rename loop can run with the literal glob when no APKs
exist; modify the step so you first expand the pattern into an array
(files=(app-*-release.apk)) or enable nullglob (shopt -s nullglob) and then
check if the array is empty before the for loop; if empty, emit an error message
and exit non-zero, otherwise iterate over the array (for apk in "${files[@]}")
and run mv "koshika-${{ github.ref_name }}-${apk#app-}" only for real files to
avoid spurious mv errors.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a1696475-d27d-4f8b-8039-55bdb048f148
📒 Files selected for processing (2)
.github/workflows/release.ymlandroid/app/build.gradle.kts
Summary
Results
Further reduction to ~35–45 MB requires replacing
flutter_gemmawithllama_cpp_dart(phase 2).Test plan
Summary by CodeRabbit
Release Notes
Chores