Repository navigation
Fix the native build on React Native 0.88 and AGP 9 - #9
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified 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, addressing iOS bridge compilation and Android build configuration compatibility.
Changes:
- Uses
RCTBridgeand an explicit runtime selector declaration instead of the removedRCTCxxBridgetype. - Enables Android
BuildConfiggeneration and removes unused Kotlin plugin configuration and dependencies. - Documents both compatibility fixes in the unreleased changelog.
| File | Description |
|---|---|
native/ios/WatermelonDB/objc/WMDatabaseBridge.m |
Passes RCTBridge directly to the JSI installer. |
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 plugin and dependency setup. |
CHANGELOG-Unreleased.md |
Records the iOS and Android compatibility fixes. |
Review effort: Balanced
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.
React Native 0.88 removed
RCTCxxBridge(and its declaration inRCTBridge+Private.h), soJSIInstaller.h/.mmandWMDatabaseBridge.mno longer compile. AGP 9 (Expo SDK 54+) stops generatingBuildConfigfor library modules and ships its own Kotlin support, which fails when a module also applieskotlin-android.iOS
installWatermelonJSItakes a plainRCTBridge *and declares the-runtimeselector in a category. Both the legacyRCTCxxBridgeand the bridgelessRCTBridgeProxyrespond to it, so JSI installs on the bridge and in bridgeless mode alike. No behaviour change on React Native < 0.88.Android
buildFeatures { buildConfig true }: the Java sources readBuildConfig.DEBUG.kotlin-androidplugin, its classpath entry and the stdlib dependency are removed. This is the same conflict fix(android): skip explicit Kotlin plugin when AGP registers the kotlin extension Nozbe/WatermelonDB#1974 guards against; removing the plugin removes the cause.Tested
jsi: false, and the installer path compiles and runs withjsi: trueas well).buildConfigline is what we previously injected from an Expo config plugin for the same builds.yarn ci:checksuites for the touched JS areas pass; this PR changes no JavaScript.Fixes Nozbe#1969, fixes Nozbe#1974 (same root cause), related to Nozbe#1769.
Same change as Nozbe#1978 (commit 220e753), rebuilt on the current
kenhubbecause #1 conflicted in CHANGELOG-Unreleased.md after #6, #7 and #8 landed. Supersedes #1.