Replies: 3 comments 2 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
-
Bumping this as I run into it multiple times per year |
Beta Was this translation helpful? Give feedback.
0 replies
-
@shamilovtim Array can be reinterpreted as Data using |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I'm trying to use turbo native modules to develop a RN library to encode/decode packets for a serial custom protocol.
This RN library will call an already developed C library that makes all the hard stuff about encoding/decoding.
I've already managed to make it work (at least the encoding part) in iOS.
In this case the spec file defines a method that return a "number[]" type.
In objective-c this is mapped by Codegen to "NSArray *" and this works correctly without big issues.
Problems come when trying to return this byte array in Android.
The Codegen maps "number[]" to WritableArray in Java, then the call to JNI requires the return value to be a jobject (I've also tried to use jbyteArray but nothing changes).
Every time I try to return a jobject from JNI to Java the application crashes (SIGABRT).
No problems with other primitive types as jdouble or jstring.
For now the only solution is to return the string hex representation of the byte array but it's not a good solution IMHO.
Thank you for your help.
PS: I'm using RN 0.72.4.
Beta Was this translation helpful? Give feedback.
All reactions