Skip to content

Rebuilding the Android development client takes 67.7 s, and 21.6 s of that is Gradle and native caches the clean prebuild deletes #18921

Open

Description

@bompus

What happened

scripts/mobile-native-client.ts runs expo prebuild --clean --platform android before Gradle. The clean prebuild deletes the generated android directory, including .gradle and app/.cxx, so a repeated build with unchanged source starts Gradle task history and native compilation from nothing.

Diagnosis

The two directories are regenerable caches whose contents Gradle and Ninja check against their inputs. PR #18073 moves them aside on the same filesystem before prebuild and restores them before Gradle runs; prebuild still regenerates native source, autolinking and bundle outputs. If prebuild fails or is interrupted, the saved files are restored or kept with a printed recovery path.

Steps to reproduce

  1. Build an Android development client with scripts/mobile-native-client.ts.
  2. Build again with the app source unchanged.
  3. The second build repeats work the first one already did.

Version

0.0.44

Environment

Ubuntu on WSL2, Ryzen 9 9950X3D (16 vCPUs), Node 24.21.0, Java 17. Warm shared Gradle cache, ARM64 debug build.

Evidence

Clean prebuild plus ARM64 debug build, same revision, 6 measured runs each in alternating order after warm-ups: mean 67.7 s before, 46.2 s after (21.6 s, 31.8% lower); sample standard deviations 3.0 s and 2.3 s. Linux (WSL) only, warm repeated debug builds. Cold builds, macOS and Windows were not measured.

Related issues

#15412 (earlier PR, closed for a missing model line), #18161 (this report as first filed with the CLI, without the form)

Fix applied or workaround

PR #18073 is open. Is this a bug fix you would take as a PR, or should it go through an Ideas discussion first? I will leave the PR as is until you say.

Filed by

claude (sonnet-5.5) via t3 triage

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions