-
Notifications
You must be signed in to change notification settings - Fork 16
Fix/rn 0.78 compatibility #295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ve 0.78. The correct method is runOnUiQueueThread()
…stead of broken third-paty, add retry logic
- Set minimum iOS version to 13.0 (required by react-native-ldk) - Add pre_install hook to patch boost podspec to use sourceforge mirror - Add post_install hook to enforce iOS 13.0 deployment target for all pods - Fixes CI failures in e2e-ios, mocha-ios workflows Related: facebook/react-native#37748 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Worked locally, trying to fix the CI |
…nished initializing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes Android build compatibility issues with React Native 0.78 by updating deprecated APIs and improving context access patterns in the react-native-ldk package.
Key changes:
- Added a getter method for ReactContext in LdkEventEmitter to resolve reference errors
- Replaced deprecated
runOnUiThread()withrunOnUiQueueThread()for RN 0.78 compatibility - Added Metro config blocklist to prevent nested dependency conflicts
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| lib/package.json | Version bump to 0.0.162 |
| lib/android/src/main/java/com/reactnativeldk/classes/LdkPersister.kt | Updated to use new context getter and RN 0.78 thread method |
| lib/android/src/main/java/com/reactnativeldk/LdkModule.kt | Added getReactContext() getter method to LdkEventEmitter |
| example/tests/eclair.ts | Added missing trailing comma |
| example/metro.config.js | Added blocklist to exclude nested node_modules |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The CI failures will be fixed in other branch |
ovitrif
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with some nit comments for cleanup as feasible.
|
|
||
| // Update chain monitor on main thread | ||
| LdkModule.reactContext?.runOnUiThread { | ||
| LdkEventEmitter.getReactContext()?.runOnUiQueueThread { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this change doesn't make a lot of sense to me. Why would we change what was already there?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method runOnUiThread doesn't exist on ReactContext class, that is why I assumed it was removed
https://github.com/facebook/react-native/blob/0ee4a2d01a7abac197851d648260a7a34648c59d/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java#L369
Here you can see that ReactContextBaseJavaModule is a child of BaseJavaModule
https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContextBaseJavaModule.kt
And here you can see that the mReactApplicationContext is a private property
https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/BaseJavaModule.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the ReactNative version of the project was updated
|
|
||
| //Update chain monitor with successful persist on main thread | ||
| LdkModule.reactContext?.runOnUiThread { | ||
| LdkEventEmitter.getReactContext()?.runOnUiQueueThread { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this change doesn't make a lot of sense to me. Why would we change what was already there?!
Description
Fixes Android build errors when using react-native-ldk with React Native 0.78.
Problem
The package fails to compile on RN 0.78 with errors:
Unresolved reference 'reactContext'Unresolved reference 'runOnUiThread'Solution
getReactContext()getter method toLdkEventEmitterobjectLdkPersister.ktto useLdkEventEmitter.getReactContext()instead ofLdkModule.reactContextrunOnUiThread()withrunOnUiQueueThread()Testing