Skip to content

fix(android): link error on React Native 0.82–0.85 - #937

Merged
lodev09 merged 1 commit into
mainfrom
fix/android-rn082-scopeguard-link
Oct 17, 2026
Merged

lodev09 merged 1 commit into
mainfrom
fix/android-rn082-scopeguard-link

Conversation

@lodev09

@lodev09 lodev09 commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

Android builds on React Native 0.82–0.85 failed to link libreact_codegen_TrueSheetSpec.so:

ld.lld: error: undefined symbol: folly::detail::ScopeGuardImplBase::terminate()

TrueSheetContentViewShadowNode.cpp used folly::makeGuard, which references ScopeGuardImplBase::terminate(). React Native compiles folly's ScopeGuard.cpp into a static folly_runtime that is linked into libreactnative.so without --whole-archive. The object is only kept when React Native's own code uses it, which started in 0.86 (SCOPE_EXIT in EventQueueProcessor.cpp, react/react-native#56537). Before 0.86 the symbol isn't exported. The example apps are on 0.86+, so it was never caught.

The measuring flag is now reset by a local RAII struct. Behavior is the same: the folly guard's terminate() path only ran if the lambda threw, and it can't.

Fixes #931

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Test Plan

Build Result
New RN 0.82.1 app (Gradle 9.0, NDK r27, arm64), main ❌ the link error from #931
New RN 0.82.1 app, this branch ✅ builds
Bare example Android (RN 0.86) ✅ builds
Bare example iOS (RN 0.86) ✅ builds
  • llvm-nm: libreactnative.so exports ScopeGuardImplBase::terminate() in 0.86.0, not in 0.82.1. With this change libreact_codegen_TrueSheetSpec.so no longer imports it.
  • Smoke test on the RN 0.82.1 app (Android emulator, API 37), detents={['auto']}: the sheet presents at its content height, grows when rows are added (+300dp for 6 rows of 50dp), and presents at the same height after a dismiss.

Not tested on device: iOS and the bare example (build only).

Screenshots / Videos

N/A

Checklist

  • I tested on iOS
  • I tested on Android
  • I tested on Web
  • I updated the documentation (if needed)
  • I added a changelog entry (if needed)

No changelog entry: the bug came from #838, which is unreleased (v4 betas only).

folly::makeGuard needs ScopeGuardImplBase::terminate(), which
libreactnative.so only exports from React Native 0.86. Reset the
measuring flag with a local RAII struct instead.

Fixes #931
@vercel

vercel Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
react-native-true-sheet Ready Ready Preview Oct 17, 2026 3:08am UTC

Request Review

@lodev09
lodev09 merged commit 9235d15 into main Oct 17, 2026
5 of 6 checks passed
@lodev09
lodev09 deleted the fix/android-rn082-scopeguard-link branch October 17, 2026 03:09
@lodev09

lodev09 commented Oct 27, 2026

Copy link
Copy Markdown
Owner Author

🚀 This pull request is included in v4.0.0. See Release 4.0.0 for release notes.

This branch was successfully deployed

1 active deployment
Preview — 861835fa Deployed Oct 17, 2026 by vercel[bot]
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.

[v4 beta] Android link error on React Native 0.82: undefined symbol folly::detail::ScopeGuardImplBase::terminate()

1 participant