Skip to content

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

Closed
joker-777 wants to merge 1 commit into
kenhubfrom
fix/rn-0.88-bridgeless-build
Closed

joker-777 wants to merge 1 commit into
kenhubfrom
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 Nozbe#1969, fixes Nozbe#1974 (same root cause), related to Nozbe#1769.

Also opened upstream as Nozbe#1978.

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>
Copilot AI balanced review requested due to automatic review settings October 30, 2026 23:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the React Native 0.88 and Android Gradle Plugin 9 compatibility updates.

No open issues 🎉

What changed in this PR

Updates WatermelonDB’s native integration for React Native 0.88 and Android Gradle Plugin 9 compatibility.

Changes:

  • Replaces iOS installer references to RCTCxxBridge with RCTBridge and declares the runtime selector for legacy bridges and bridgeless proxies.
  • Explicitly enables Android BuildConfig generation and removes the unused Kotlin plugin, dependency, and version property.
  • Documents the compatibility fixes in the unreleased changelog.
File Description
native/​ios/​WatermelonDB/​objc/​WMDatabaseBridge.m Passes RCTBridge to the JSI installer without the removed bridge type cast.
native/​ios/​WatermelonDB/​JSIInstaller.mm Updates the installer type and declares the runtime selector.
native/​ios/​WatermelonDB/​JSIInstaller.h Uses the public bridge header and updates the installer signature.
native/​android/​gradle.properties Removes the unused Kotlin version property.
native/​android/​build.gradle Enables BuildConfig and removes Kotlin build configuration.
CHANGELOG-Unreleased.md Records the iOS and Android compatibility fixes.

Review effort: Balanced

@joker-777

Copy link
Copy Markdown
Author

Superseded by #9, the same commit rebuilt on the current kenhub (only the changelog conflicted). The branch stays as the head of the upstream PR Nozbe#1978.

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.

2 participants