Repository navigation
Androidビルド速度を最適化するためGradle設定を調整 - #5408
Merged
Merged
Conversation
Contributor
📝 WalkthroughウォークスルーAndroid プロジェクトの Gradle 設定を最適化するため、JVM ヒープサイズを 2GB から 4GB に増加し、Gradle ビルドキャッシングを有効化しました。また、PNG クランチングを無効化し、React Native ビルドの対応アーキテクチャを arm64-v8a に限定して Play Store AAB ビルドの効率性を向上させました。 変更内容
推定レビュー工数🎯 1 (Trivial) | ⏱️ ~3 minutes 関連する可能性のあるプルリクエスト
提案ラベル
ポエム
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Contributor
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@android/gradle.properties`:
- Line 13: The org.gradle.jvmargs setting currently forces a 4GB heap
(-Xmx4096m) which can fail on low-memory CI/dev machines; change this to a safer
default (e.g. -Xmx1536m or -Xmx2048m) or make it overridable by environment/CI
(use GRADLE_OPTS or read a project property) so CI can supply a larger value
when available; update the org.gradle.jvmargs entry to a lower default and
document/allow overriding in CI by referencing the org.gradle.jvmargs key.
- Around line 34-36: The gradle property reactNativeArchitectures is hard-set to
"arm64-v8a", which excludes x86/x86_64 and 32-bit devices for all builds; change
the configuration so it's not globally fixed—either remove or unset the
reactNativeArchitectures entry from gradle.properties and rely on passing
-PreactNativeArchitectures=arm64-v8a only during CI release builds (or set a
neutral default like empty) so local/emulator and 32-bit builds still work;
update any CI build scripts to inject -PreactNativeArchitectures=arm64-v8a for
Play Store AAB releases and leave the reactNativeArchitectures property unset
for development.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EASでのAndroidビルドがiOS(約14分)に比べて約24分と遅いため、
android/gradle.propertiesのGradle設定を最適化しました。変更内容と期待される効果
1. ネイティブアーキテクチャを
arm64-v8aのみに削減(最大の効果)armeabi-v7a,arm64-v8a,x86,x86_64(4アーキテクチャ)arm64-v8a(1アーキテクチャ)arm64-v8aのみで十分です。x86/x86_64はエミュレータ専用、armeabi-v7aは32bitレガシーデバイス向けで現在のユーザーベースではほぼ不要です。-PreactNativeArchitectures=x86_64で上書き可能です。2. JVMヒープ増加とGC最適化
-Xmx2048m-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC3. Gradleビルドキャッシュの有効化
org.gradle.caching=true4. PNGクランチの無効化
android.enablePngCrunchInReleaseBuilds=trueandroid.enablePngCrunchInReleaseBuilds=falseRegression risk assessment
Test plan
-PreactNativeArchitectures=x86_64で上書きできることを確認https://claude.ai/code/session_01VUGJtVwbG5uzxLTSgFNJ5G
Summary by CodeRabbit
リリースノート