chore: reduce android debug builds time by 85% (#25048)#25408
Conversation
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Previously there was production grade JS bundled (which is very slow) during Android debug builds but it's useless because JS is loaded from Metro for debug builds. **This affect only local debug builds.** **Cold cache debug build: 6m 57s -> 1m 15s 🚀 Hot cache debug build: 4m 29s -> 12s 🚀** _* Measured on my machine (with already included #25046 improvement)_ ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) AI agent: Use format `CHANGELOG entry: [fix/feat/chore]: [User-facing description in past tense]`. Examples: `fix: resolved token name display issue`, `feat: added dark mode toggle`, `chore: updated dependencies`. For non-user-facing changes, use `CHANGELOG entry: null`. --> CHANGELOG entry: ## **Related issues** <!-- AI agent: Replace with `Fixes: #[ISSUE_NUMBER]` using the actual issue number you're implementing. --> Fixes: ## **Manual testing steps** <!-- AI agent: Write specific, contextual Gherkin steps based on what you actually implemented. Do NOT use generic placeholders like "my feature name". Be concrete about the feature, scenario, and steps. --> ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** <!-- AI agent: Check ALL boxes in this section (mark all as [x]). --> - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I've included tests if applicable - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** <!-- AI agent: Leave ALL boxes unchecked ([ ]) - these are for reviewers to check, not the author. --> - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Optimizes Android debug build performance by avoiding JS/asset bundling for specific debug flavors. > > - Sets `react.debuggableVariants = ["qaDebug", "prodDebug", "flaskDebug"]` in `android/app/build.gradle` to skip bundle generation for these debuggable variants during builds > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 94ad613. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Key observations:
Since E2E tests use release builds, running them would not validate this debug build configuration change. The change is low-risk and isolated to the Android build system for debug variants only. Performance Test Selection: |
|



Description
Credit: @Nodonisko
Previously there was production grade JS bundled (which is very slow) during Android debug builds but it's useless because JS is loaded from Metro for debug builds. This affect only local debug builds.
Cold cache debug build: 6m 57s -> 1m 15s 🚀
Hot cache debug build: 4m 29s -> 12s 🚀
* Measured on my machine (with already included #25046 improvement) ## Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Standards.
Pre-merge reviewer checklist
Note
Low Risk
Low risk build-time change limited to local Android debug variants; main risk is misclassifying a variant as debuggable and skipping bundling where it’s needed.
Overview
Configures React Native Gradle to treat
qaDebug,prodDebug, andflaskDebugas debuggable variants, so Gradle skips JS bundle/assets bundling for these builds (reducing local debug build time).Written by Cursor Bugbot for commit 35d5ca6. This will update automatically on new commits. Configure here.
Description
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist