Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up Android builds #49567

Open
roryabraham opened this issue Sep 21, 2024 · 7 comments
Open

Speed up Android builds #49567

roryabraham opened this issue Sep 21, 2024 · 7 comments
Assignees
Labels

Comments

@roryabraham
Copy link
Contributor

Problem

Android builds typically take 10-30 minutes on my M2 Mac, which is a long time.

Solution

Research ways to speed them up

@roryabraham roryabraham added the Monthly KSv2 label Sep 21, 2024
@roryabraham roryabraham self-assigned this Sep 21, 2024
@roryabraham roryabraham changed the title Try to speed up Android builds Speed up Android builds Sep 21, 2024
@roryabraham
Copy link
Contributor Author

There are a few things I'd like to try:

  • Enable gradle cache
  • Enable gradle parallel task execution
  • Enable ccache

@roryabraham
Copy link
Contributor Author

In order to be methodic and quantitative with these changes, I'll be using ./gradlew build --scan to generate detailed build scan reports.

@saifelance

This comment was marked as off-topic.

@roryabraham

This comment was marked as off-topic.

@roryabraham
Copy link
Contributor Author

Build scan for a clean ./gradlew assembleDebug (note: next time I should do active arch only, because that's what we do in dev)

https://scans.gradle.com/s/4e4x4kl55d3js

@roryabraham
Copy link
Contributor Author

Another clean build scan, this time only one arch: https://scans.gradle.com/s/4apezfw7xtotm

@roryabraham
Copy link
Contributor Author

A build scan with only this diff:

diff --git a/android/gradle.properties b/android/gradle.properties
index 87333d20f74..1f60a7d335d 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -55,3 +55,6 @@ MYAPP_UPLOAD_KEY_ALIAS=ReactNativeChat-Key-Alias
 disableFrameProcessors=true
 
 android.nonTransitiveRClass=false
+
+org.gradle.parallel=true

https://scans.gradle.com/s/67qe4vuqgytyq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants