Skip to content

Fix the native build on React Native 0.88 and AGP 9 - #1978

Open
joker-777 wants to merge 1 commit into
Nozbe:masterfrom
kenhub:fix/rn-0.88-bridgeless-build
Open

joker-777 wants to merge 1 commit into
Nozbe:masterfrom
kenhub:fix/rn-0.88-bridgeless-build

Conversation

@joker-777

Copy link
Copy Markdown

React Native 0.88 removed RCTCxxBridge (and its declaration in RCTBridge+Private.h), so JSIInstaller.h/.mm and WMDatabaseBridge.m no longer compile. AGP 9 (Expo SDK 54+) stops generating BuildConfig for library modules and ships its own Kotlin support, which fails when a module also applies kotlin-android.

iOS

  • installWatermelonJSI takes a plain RCTBridge * and declares the -runtime selector in a category. Both the legacy RCTCxxBridge and the bridgeless RCTBridgeProxy respond to it, so JSI installs on the bridge and in bridgeless mode alike. No behaviour change on React Native < 0.88.

Android

Tested

  • The iOS change is the patch Kenhub has shipped in production builds on Expo SDK 58 / React Native 0.88.1 (new architecture, jsi: false, and the installer path compiles and runs with jsi: true as well).
  • The buildConfig line is what we previously injected from an Expo config plugin for the same builds.
  • yarn ci:check suites for the touched JS areas pass; this PR changes no JavaScript.

Fixes #1969, fixes #1974 (same root cause), related to #1769.

iOS: React Native 0.88 removed RCTCxxBridge and its declaration in
RCTBridge+Private.h, so JSIInstaller and WMDatabaseBridge no longer
compiled. The installer now takes a plain RCTBridge and declares the
-runtime selector itself; both the legacy RCTCxxBridge and the
bridgeless RCTBridgeProxy respond to it, so JSI installs on either.

Android: AGP 9 stops generating BuildConfig for library modules, but
the Java sources read BuildConfig.DEBUG, so the module enables
buildFeatures.buildConfig explicitly. The module has had no Kotlin
sources since the Java rewrite, and applying kotlin-android collides
with AGP 9's built-in Kotlin extension, so the plugin, its classpath
and the stdlib dependency go.

Fixes Nozbe#1969, fixes Nozbe#1974 (same root cause), related to Nozbe#1769.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
joker-777 added a commit to kenhub/WatermelonDB that referenced this pull request Oct 31, 2026
iOS: React Native 0.88 removed RCTCxxBridge; the JSI installer takes a plain RCTBridge and declares -runtime itself, so it works on the bridge and in bridgeless mode. Android: enable buildFeatures.buildConfig for AGP 9 and drop the unused Kotlin plugin, which collides with AGP 9's built-in Kotlin support. Same change as Nozbe#1978.
abhijeet1403 added a commit to Mera-News/mera-app that referenced this pull request Nov 1, 2026
… bridgeless via a prebuild plugin

RN 0.88 removed RCTCxxBridge, so the WatermelonDB 0.28.0 pod (and 0.28.1-0,
and upstream master) fails with "unknown type name 'RCTCxxBridge'". No
published release fixes it; upstream's open PR Nozbe/WatermelonDB#1978 makes
the same change. withWatermelonBridgelessJsi takes a plain RCTBridge and
declares -runtime in a category: in bridgeless mode the module's bridge is an
RCTBridgeProxy, which still returns the live jsi::Runtime, and initializeJSI
stays a blocking sync call so the JS thread is parked during the install.

A dangerous mod, anchor-or-throw and idempotent like withWatermelonBusyTimeout,
because the pod compiles from node_modules and the repo has no patch-package.
The contract test reads the installed sources so a WatermelonDB bump that
moves an anchor fails in jest, not in an EAS build. Delete the plugin once a
release ships #1978.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@StasDoskalenko

Copy link
Copy Markdown

Hi @joker-777, thank you so much for putting this together!

I maintain NitromelonDB, a maintained fork of WatermelonDB (New Architecture, Nitro Modules). It already builds on Expo SDK 58 / React Native 0.88 and AGP 9: the native side goes through Nitro, so there is no RCTCxxBridge dependency, and the Android module enables buildConfig and only applies kotlin-android when AGP hasn't registered Kotlin itself.

If you're already on 0.88, you'd be very welcome to give it a try. Existing SQLite files, schema and models keep working, and there's a migration guide. The fork was also rewritten in TypeScript (strict mode) to reduce the chance of bugs slipping through, so any feedback or PRs from you would be really appreciated.

Happy to help if anything comes up. Thanks!

This branch has not been deployed

No deployments
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.

Question: Current support status for React Native New Architecture / Expo SDK 54+

2 participants