You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a Java @ReactMethod ask for a Callback and a Promise, React native will throw :
"Error: Exception in HostFunction: Malformed calls from JS: field sizes are different."
If Hermes is enabled, the app will just crash with :
"A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL)"
React Native version:
I tried on 0.63.0 and 0.63.1. Same issue.
Steps To Reproduce
Init a new RN project
Create a Java module with a method asking a Callback and a Promise : @ReactMethod public void jCall(Callback cb, Promise p){ ... }
Call it from Javascript await _javaModule.jCall((e)=>{ ... })
Expected Results
The method should be called, passing the react.bridge.Callback and implicitly a react.bridge.Promise to the Java side and not crash.
Edit
After a few more tests (all with Hermes enabled), there are my results :
When two Callback are required, everything works. @ReactMethod public void jCall(Callback res, Callback rej){ ... } await _javaModule.jCall((e)=>{ ... }, (e)=>{ ... })
When three Callback are required, It doesn't crash this time but throw an error. @ReactMethod public void jCall(Callback cb, Callback res, Callback rej){ ... } await _javaModule.jCall((e)=>{ ... }, (e)=>{ ... }, (e)=>{ ... })
Throw : Malformed calls from JS: field sizes are different
It seems that we can't invoke multiple distincts callbacks. Which explain some of my results. Is it meant to be that way ? If so, the official documentation isn't clear.
The text was updated successfully, but these errors were encountered:
Description
If a Java @ReactMethod ask for a Callback and a Promise, React native will throw :
If Hermes is enabled, the app will just crash with :
React Native version:
I tried on 0.63.0 and 0.63.1. Same issue.
Steps To Reproduce
@ReactMethod public void jCall(Callback cb, Promise p){ ... }
await _javaModule.jCall((e)=>{ ... })
Expected Results
The method should be called, passing the react.bridge.Callback and implicitly a react.bridge.Promise to the Java side and not crash.
Edit
After a few more tests (all with Hermes enabled), there are my results :
When two Callback are required, everything works.
@ReactMethod public void jCall(Callback res, Callback rej){ ... }
await _javaModule.jCall((e)=>{ ... }, (e)=>{ ... })
When three Callback are required, It doesn't crash this time but throw an error.
@ReactMethod public void jCall(Callback cb, Callback res, Callback rej){ ... }
await _javaModule.jCall((e)=>{ ... }, (e)=>{ ... }, (e)=>{ ... })
Throw :
Malformed calls from JS: field sizes are different
It seems that we can't invoke multiple distincts callbacks. Which explain some of my results. Is it meant to be that way ? If so, the official documentation isn't clear.
The text was updated successfully, but these errors were encountered: