Skip to content

Commit 67bca6c

Browse files
fix(mobile): Android fingerprint covers Expo native modules again (#20384)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent ac251a2 commit 67bca6c

4 files changed

Lines changed: 45 additions & 2 deletions

File tree

‎.github/workflows/mobile-eas-production.yml‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,29 @@ jobs:
234234
MOBILE_BUILD_PROFILE: ${{ inputs.profile || 'production' }}
235235
run: eas build --platform ${{ inputs.platform }} --profile "$MOBILE_BUILD_PROFILE" --auto-submit --non-interactive --no-wait
236236

237+
# @expo/fingerprint swallows autolinking errors and returns no Expo module
238+
# sources, so native changes stop moving the hash and OTAs reach binaries
239+
# that lack them. Refuse to publish any OTA from such a fingerprint.
240+
- name: Verify fingerprints hash Expo native modules
241+
if: steps.expo-token.outputs.present == 'true' && (github.event_name == 'push' || inputs.mode == 'update')
242+
working-directory: apps/mobile
243+
env:
244+
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
245+
PLATFORM: ${{ inputs.platform || 'all' }}
246+
run: |
247+
if [ "$PLATFORM" = "all" ]; then platforms="ios android"; else platforms="$PLATFORM"; fi
248+
failed=0
249+
for platform in $platforms; do
250+
# eas-cli prints an environment-loaded notice to stdout before the
251+
# JSON even with --json, so discard everything before the document.
252+
expo_modules="$(eas fingerprint:generate --platform "$platform" --environment production --json --non-interactive | sed -n '/^{/,$p' | jq --arg reason "expoAutolinking${platform^}" '[.sources[] | select((.reasons // []) | index($reason))] | length')"
253+
if [ "${expo_modules:-0}" -eq 0 ]; then
254+
failed=1
255+
echo ":x: $platform: the native fingerprint hashes no Expo native modules — OTAs and builds skipped" >> "$GITHUB_STEP_SUMMARY"
256+
fi
257+
done
258+
exit "$failed"
259+
237260
- name: Publish OTA update (manual)
238261
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'update'
239262
working-directory: apps/mobile

‎patches/@[email protected]‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
diff --git a/build/sourcer/Expo.js b/build/sourcer/Expo.js
2+
index 785ec516921af68ea5922462a0177112e15c6bb1..8ce5ce7937b83b3677416bf18f4c60d759ba4fcf 100644
3+
--- a/build/sourcer/Expo.js
4+
+++ b/build/sourcer/Expo.js
5+
@@ -368,6 +368,11 @@ async function getExpoAutolinkingAndroidSourcesAsync(projectRoot, options, expoA
6+
}
7+
if (module1.plugins) {
8+
for (const plugin of module1.plugins){
9+
+ // Gradle plugins resolved from Maven (e.g. expo-widgets' glance fork) have no
10+
+ // sourceDir; hashing them would throw and drop every Expo module source.
11+
+ if (typeof plugin.sourceDir !== 'string') {
12+
+ continue;
13+
+ }
14+
const filePath = (0, _Path.toPosixPath)(_path().default.relative(realProjectRoot, plugin.sourceDir));
15+
plugin.sourceDir = filePath; // use relative path for the dir
16+
debug(`Adding expo-modules-autolinking android dir - ${_chalk().default.dim(filePath)}`);

‎pnpm-lock.yaml‎

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pnpm-workspace.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,9 @@ patchedDependencies:
332332
# Android: a nested WebView hands a vertical drag to its scrolling parent at the page's edge.
333333
334334
335+
# Android: Maven-resolved gradle plugins (expo-widgets) have no sourceDir; without this
336+
# skip, the fingerprint silently drops every Expo native module and OTAs reach stale binaries.
337+
335338

336339
peerDependencyRules:
337340
allowAny:

0 commit comments

Comments
 (0)