Skip to content

[Bug]: Android native-client builds lose Gradle history and native compile outputs on every clean prebuild, costing about 22 s of a 68 s build #18161

Closed as not planned

Description

@bompus

Every clean Android prebuild deletes the Gradle history and native compile outputs, adding about 22 s to a 68 s build (pull request 18073 measured 67.7 s against 46.2 s).

Area: Build, CI, or release tooling

Steps to reproduce

  1. Build an Android development client with scripts/mobile-native-client.ts (it runs expo prebuild --clean --platform android, then Gradle).
  2. Build again with the app source unchanged.

Expected behavior
The second build reuses Gradle task history and the app's native compilation outputs, since their inputs have not changed.

Actual behavior
The clean prebuild deletes the generated android directory, which also deletes .gradle and app/.cxx. Every repeated build starts those from nothing.

Measured in #18073: a clean prebuild plus ARM64 debug Gradle build on the same unchanged revision took a mean of 67.7 s without the change and 46.2 s with it (21.6 s, 31.8% lower), six runs each in alternating order, with a warm shared Gradle cache. That was Linux (WSL) only, for warm repeated debug builds. It does not cover cold builds, macOS or Windows.

Impact: Minor bug or occasional failure
Version or commit: main at 8d199b4 (scripts/mobile-native-client.ts still runs prebuild --clean)
Environment: Ubuntu on WSL2, Node 24, Java 17

Proposed fix: PR #18073 moves the two directories aside before prebuild and restores them before Gradle runs, and keeps them recoverable if prebuild fails or is interrupted.

Activity

  1. changed the title [-][Bug]: Android native-client builds lose Gradle history and native compile outputs on every clean prebuild[/-] [+][Bug]: Android native-client builds lose Gradle history and native compile outputs on every clean prebuild, costing about 22 s of a 68 s build[/+] on Oct 12, 2026
  2. bompus commented on Oct 13, 2026

    @bompus
    ContributorAuthor

    Superseded by #18921, which has the same report filed through the triage form. Tracked there; PR #18073 now links it.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions