Is anybody pass Uint8Array to native module in React Native. I haveError Malformed calls from JS

404 Views Asked by At

I try to pass ByteArray to Java Wrapper of my native module, but get error:

Error: Exception in HostFunction: Malformed calls from JS: field sizes are different.

[[20,20,20,20,20,20,20,20,20,20,4,36],[17,9,2,19,17,9,2,19,17,9,0,0],[[1856,3641,{"iterations":1,"toValue":1,"frames":[0,0.008888888888888889,0.035555555555555556,0.08000000000000002,0.14222222222222222,0.2222222222222222,0.32000000000000006,0.4355555555555556,0.5644444444444444,0.6799999999999999,0.7777777777777777,0.8577777777777778,0.92,0.9644444444444444,0.9911111111111112,1],"type":"frames"},56817],[],[3730,2445],[],[1857,3636,{"iterations":1,"toValue":1,"frames":[0,0.008888888888888889,0.035555555555555556,0.08000000000000002,0.14222222222222222,0.2222222222222222,0.32000000000000006,0.4355555555555556,0.5644444444444444,0.6799999999999999,0.7777777777777777,0.8577777777777778,0.92,0.9644444444444444,0.9911111111111112,1],"type":"frames"},56825],[],[3732,2453],[],[1858,3644,{"iterations":1,"toValue":1,"frames":[0,0.008888888888888889,0.035555555555555556,0.08000000000000002,0.14222222222222222,0.2222222222222222,0.32000000000000006,0.4355555555555556,0.5644444444444444,0.6799999999999999,0.7777777777777777,0.8577777777777778,0.92,0.9644444444444444,0.9911111111111112,1],"type":"frames"},56833],[],[814,100,1668782523552,false]],28408]

Try to pass only Int to Java wrapper and all is worked, but if i pass Uint8Array have this error.

1

There are 1 best solutions below

1
On

Use ReadableArray to pass data and WritableArray to pass back to Javascript.

See Argument Types for the list of supported types.