[build] - preflight check for stale autolinked Android native modules#3701
Open
AbbanMustafa wants to merge 1 commit into
Open
[build] - preflight check for stale autolinked Android native modules#3701AbbanMustafa wants to merge 1 commit into
AbbanMustafa wants to merge 1 commit into
Conversation
|
Subscribed to pull request
Generated by CodeMention |
|
⏩ The changelog entry check has been skipped since the "no changelog" label is present. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3701 +/- ##
==========================================
- Coverage 56.56% 56.52% -0.04%
==========================================
Files 888 888
Lines 38468 38540 +72
Branches 8022 8039 +17
==========================================
+ Hits 21756 21780 +24
- Misses 16614 16662 +48
Partials 98 98 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
~250+ Android builds fail per day with "No variants exist" because the user has
android/committed to git, which triggers the GENERIC workflow and skips prebuild.The native project is stale (new native dependencies were added or the SDK was upgraded without re-running prebuild) so Gradle fails at config time when
useReactNativeModules()tries to include modules that can't resolve against the stale native project.https://app.datadoghq.com/logs?query=%22No%20variants%20exist%22&agg_m=count&agg_m_source=base&agg_t=count&cols=host%2Cservice&messageDisplay=inline&refresh_mode=sliding&storage=hot&stream_sort=desc&viz=stream&from_ts=1778019603930&to_ts=1778278803930&live=true
How
Added a
checkAutolinkedNativeModulesAsync()preflight check invalidate.tsthat runs for GENERIC workflow Android builds, wired up increateAndroidContextAsync()alongside the existing checks.The check:
Workflow.GENERIC(managed workflow runs prebuild automatically)android/settings.gradle(.kts)to confirm autolinking is configurednpx react-native configto discover expected autolinked Android dependenciessourceDirandbuild.gradle(.kts)exist on disknpx expo prebuild --cleanor switch to managed workflow)Fails silently if
react-native configerrors — this is a best-effort check that avoids blocking users when the RN CLI isn't available.Test Plan
android/, add a new native dependency without rerunning prebuild, confirm warning appearssettings.gradle: confirm check is skipped