Skip to content

chore: reduce android debug builds time by 85% (#25048)#25408

Merged
sethkfman merged 1 commit intomainfrom
chore/improve-debug-builds-time-margelo
Jan 29, 2026
Merged

chore: reduce android debug builds time by 85% (#25048)#25408
sethkfman merged 1 commit intomainfrom
chore/improve-debug-builds-time-margelo

Conversation

@sethkfman
Copy link
Copy Markdown
Contributor

@sethkfman sethkfman commented Jan 29, 2026

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

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

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • 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.

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, and flaskDebug as 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

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

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • 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.

<!--
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 -->
@github-actions
Copy link
Copy Markdown
Contributor

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.

@metamaskbot metamaskbot added the team-mobile-platform Mobile Platform team label Jan 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
The change modifies the Android build.gradle file to uncomment and set debuggableVariants = ["qaDebug", "prodDebug", "flaskDebug"]. This is a React Native Gradle plugin configuration that specifies which build variants should skip JS bundle bundling (because they're debuggable and load JS from Metro bundler instead).

Key observations:

  1. This change only affects Android debug builds, not release builds
  2. E2E tests run on release builds (as confirmed in build-android-e2e.yml which builds flask/release and prod/release variants)
  3. No app code, UI components, or user-facing functionality is modified
  4. The change is a straightforward build configuration adjustment for local development

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:
This change only affects Android debug build configuration (debuggableVariants setting). It does not impact app runtime performance, UI rendering, data loading, or any user-facing functionality. Performance tests run on release builds and would not be affected by this debug build configuration change.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@sethkfman sethkfman enabled auto-merge January 29, 2026 20:30
@sethkfman sethkfman added this pull request to the merge queue Jan 29, 2026
Merged via the queue into main with commit f89a4df Jan 29, 2026
66 of 70 checks passed
@sethkfman sethkfman deleted the chore/improve-debug-builds-time-margelo branch January 29, 2026 20:50
@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2026
@metamaskbot metamaskbot added the release-7.65.0 Issue or pull request that will be included in release 7.65.0 label Jan 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.65.0 Issue or pull request that will be included in release 7.65.0 size-XS team-mobile-platform Mobile Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants