Skip to content

[build-tools] Regenerate Android autolinking after cache restore - #4288

Open
expo-tuft[bot] wants to merge 2 commits into
mainfrom
tuft/1787714902.933849/clear-autolinking-cache
Open

[build-tools] Regenerate Android autolinking after cache restore#4288
expo-tuft[bot] wants to merge 2 commits into
mainfrom
tuft/1787714902.933849/clear-autolinking-cache

Conversation

@expo-tuft

@expo-tuft expo-tuft Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Why

SDK 54 Android builds can restore React Native's generated android/build/generated/autolinking/autolinking.json from a Windows environment. The file contains absolute C:\\... native module paths. On the Linux worker, Gradle then links each module project to a nonexistent directory and reports No matching variant ... No variants exist.

This cluster produced 465 Datadog events over seven days. The dominant AGP 8.11.0 / SDK 54 cluster accounts for 318 events across 177 accounts and 178 apps. Datadog logs

Related reports identified the stale cross-platform autolinking file and recommended deleting the generated directory as a workaround: expo/expo#42370, expo/expo#47354.

Authored with @AbbanMustafa.

What changed

After restoring the user cache for an Android cloud build, remove only android/build/generated/autolinking. React Native regenerates the cache from the current worker's project paths during Gradle configuration. Other Android build outputs and caches are untouched.

Staging verification

The same SDK 54 project archive, build profile, and fingerprint (1bd5d7db7da9c689701fda1e5e1df15ad382baf2) were run against both staging workers:

Staging was restored to current main after verification (deployment).

Tests

  • yarn workspace @expo/build-tools test — 1,182 tests passed
  • monorepo typecheck — 13 projects passed
  • yarn fmt:check — passed
  • focused builder tests verify cache restoration happens before autolinking cleanup
  • cleanup unit test verifies unrelated Android build output is preserved

expo-tuft Bot and others added 2 commits August 26, 2026 17:53
Co-authored-by: abbanmustafa <19319135+abbanmustafa@users.noreply.github.com>
Co-authored-by: abbanmustafa <19319135+abbanmustafa@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

✅ Thank you for adding the changelog entry!

@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.27%. Comparing base (3f74ea3) to head (6cc7f36).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4288      +/-   ##
==========================================
+ Coverage   64.05%   64.27%   +0.22%     
==========================================
  Files        1043     1047       +4     
  Lines       48017    48294     +277     
  Branches    10133    10186      +53     
==========================================
+ Hits        30753    31036     +283     
+ Misses      17148    17142       -6     
  Partials      116      116              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants