Repository navigation
Android版AABサイズダイエット - #4475
Android版AABサイズダイエット#4475
Conversation
Walkthrough朕、宣す。Android ビルド設定を厳格化し、app と wearable のリリースで縮小・難読化を強制、app に位置情報ライブラリを追加、及びリポジトリ順序を整理した。 Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as 開発者
participant Gradle as Gradle
participant App as appモジュール
participant Wear as wearableモジュール
Dev->>Gradle: リリースビルド開始
Gradle->>App: enableBundleCompression=true, bundleCommand=export:embed, minify/shrink を適用
App-->>Gradle: 最適化済み AAB/APK 出力
Gradle->>Wear: isMinifyEnabled/isShrinkResources を適用
Wear-->>Gradle: 最適化済み APK 出力
Gradle-->>Dev: 成果物返却
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
android/gradle.properties (1)
57-57: 重複指定は削ぎ落とすが良いぞexpo.webp.animated=false が二度書かれておる。挙動は変わらぬが、徒に混乱を招く。片方を削れ。
-expo.webp.animated=falseandroid/wearable/build.gradle.kts (1)
25-33: 朕、命ずる:Releaseブロックの冗長削除とProGuardルールの整備を怠ることなかれ下記の点、早急に対応せよ。
修正箇所:
android/wearable/build.gradle.kts
release { … }内でsigningConfig = signingConfigs.getByName("debug")が二度設定されている。いずれか一行を削ぎ落とせ。点検箇所:
android/wearable/proguard-rules.pro
- 現状、Compose/Wear/Coroutines/Play Services 等のconsumer-rulesが含まれておらぬ。必要に応じてkeep規則を追記し、R8最適化時の不具合を防げ。
該当diff例:
release { - signingConfig = signingConfigs.getByName("debug") isMinifyEnabled = true isShrinkResources = true proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) - signingConfig = signingConfigs.getByName("debug") + signingConfig = signingConfigs.getByName("debug") }以上、速やかに修正せよ。
android/app/build.gradle (1)
18-18: 束ねの圧縮は既定で良し、されど切替可能にして柔を制すべしAAB削減の意図は良い。だが開発環境での柔軟性を保つため、プロパティで上書えられる形にすると吉。
- enableBundleCompression = true + enableBundleCompression = (findProperty('android.enableBundleCompression') ?: "true").toBoolean()
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
android/app/build.gradle(3 hunks)android/build.gradle(1 hunks)android/gradle.properties(1 hunks)android/wearable/build.gradle.kts(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: TinyKitten
PR: TrainLCD/MobileApp#0
File: :0-0
Timestamp: 2025-08-11T21:13:39.083Z
Learning: TinyKitten prefers concise code reviews for the TrainLCD/MobileApp repository. Keep review comments brief and to the point.
🔇 Additional comments (3)
android/build.gradle (1)
26-33: google() の先頭宣言、是とするGoogle Maven の解決順を先に据えた判断は、play-services 系の解決安定に資す。良し。
android/app/build.gradle (2)
169-169: 位置情報ライブラリの追加、是認する依存解決順も整えられており問題なし。パーミッション宣言・不要APIの縮小が適切に作用するかをご確認あれ。
113-115: 【命】R8適用&ProGuardルール検証を尽くせ
朕の号令に従い、下記要点を速やかに確認せよ。• android/app/build.gradle(113–115行目)
- shrinkResources true、minifyEnabled true の恒常適用は許容する。
• android/app/proguard-rules.pro
- 現状、Reanimated/TurboModule のみ keep 指定あり。
- Hermes、Fresco、Play Services、OkHttp/Okio 等の明示的な keep ルールは未検出。
• 手動検証すべき項目
- getDefaultProguardFile("proguard-android.txt") の内容(SDK 側デフォルト設定)
- 依存 AAR 内に同梱される proguard.txt/proguard-rules.pro の保持ルール
必要と判断すれば、追加の keep ルールを proguard-rules.pro に追記せよ。
さらに攻めたければ、以下差分を適用するがよい。効果と副作用は厳密に検証せよ。- proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" + proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"朕、諸君の努力を見守る。
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
android/app/build.gradle (2)
113-115: release で shrink/minify を常時有効、善し。R8 最適プロファイルへ切替を勧む。最適化版のデフォルト設定へ切替えることで更なる削減が見込める。リフレクション利用部の keep は万全にせよ。
- proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" + proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
169-169: play-services-location 追加は有用だが、付随事を怠るな。朕の勧告:
- 権限宣言(ACCESS_COARSE/FINE_LOCATION)とランタイム許可導線が整っているか確認せよ。
- GMS のバージョン整合のため BOM 導入を検討せよ(wearable と揃える)。
- 実使用が薄ければ R8 により除去されるか、release ビルドのメトリクスで確認せよ(AAB サイズ差・メソッド数)。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
android/app/build.gradle(4 hunks)android/gradle.properties(1 hunks)android/wearable/build.gradle.kts(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- android/gradle.properties
🚧 Files skipped from review as they are similar to previous changes (1)
- android/wearable/build.gradle.kts
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: TinyKitten
PR: TrainLCD/MobileApp#0
File: :0-0
Timestamp: 2025-08-11T21:13:39.083Z
Learning: TinyKitten prefers concise code reviews for the TrainLCD/MobileApp repository. Keep review comments brief and to the point.
🔇 Additional comments (3)
android/app/build.gradle (3)
18-18: AAB圧縮の強制、善し。朕、是を嘉す。サイズ削減に直結し、目的に適う。
135-135: dev 版 versionCode の増分、妥当なり。applicationIdSuffix により prod との逆転も支障なし。
22-22: Expo CLI export:embed サポートバージョンの確認
朕の命により、以下を点検せよ:
- Expo SDK を少なくとも v49.0.0 以上に設定しているか
- @expo/cli が v0.17.x(例: 0.17.5)以上を使用しているか
- CI 環境にて
bundleCommand = "export:embed"が期待通りに動作し、アセットが正しく埋め込まれるかこれらを確認せよ。
Summary by CodeRabbit