React-native: Malformed calls from JS: field sizes are different.

Created on 26 Jul 2019  路  10Comments  路  Source: facebook/react-native


image

React Native version:
react-native-cli: 2.0.1
react-native: 0.60.4

Steps To Reproduce

Dependencies in package.json:

"dependencies": {
"@react-native-community/netinfo": "^4.1.3",
"axios": "^0.19.0",
"querystring": "^0.2.0",
"react": "16.8.6",
"react-native": "0.60.4",
"react-native-gesture-handler": "^1.3.0",
"react-native-webview": "^5.12.1",
"react-navigation": "^3.11.1"
},
"devDependencies": {
"@babel/core": "7.5.5",
"@babel/runtime": "7.5.5",
"@react-native-community/eslint-config": "0.0.3",
"babel-jest": "24.8.0",
"eslint": "6.1.0",
"jest": "24.8.0",
"metro-react-native-babel-preset": "0.54.1",
"react-test-renderer": "16.8.6"
},
"jest": {
"preset": "react-native"
}

Describe what you expected to happen:
Getting error: Malformed calls from JS field after loading app on devices

Logs:
com.finalapp E/unknown:ReactNative: Exception in native call
com.facebook.jni.CppException: Malformed calls from JS: field sizes are different.

[[0,37],[0,0],[[31,2000,1564123896382,false]],91]
    at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
    at android.os.Looper.loop(Looper.java:148)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:232)
    at java.lang.Thread.run(Thread.java:818)

07-26 12:21:37.391 30242-30242/com.finalapp W/unknown:ReactNative: Tried to enqueue runnable on already finished thread: 'js... dropping Runnable.
07-26 12:21:37.391 30242-30242/com.finalapp W/MessageQueue: Handler (com.facebook.react.bridge.queue.MessageQueueThreadHandler) {5861b01} sending message to a Handler on a dead thread
java.lang.IllegalStateException: Handler (com.facebook.react.bridge.queue.MessageQueueThreadHandler) {5861b01} sending message to a Handler on a dead thread
at android.os.MessageQueue.enqueueMessage(MessageQueue.java:544)
at android.os.Handler.enqueueMessage(Handler.java:631)
at android.os.Handler.sendMessageAtTime(Handler.java:600)
at android.os.Handler.sendMessageDelayed(Handler.java:570)
at android.os.Handler.post(Handler.java:326)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl.runOnQueue(MessageQueueThreadImpl.java:70)
at com.facebook.react.bridge.ReactContext.runOnJSQueueThread(ReactContext.java:321)
at com.facebook.react.uimanager.events.EventDispatcher$ScheduleDispatchFrameCallback.doFrame(EventDispatcher.java:302)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:172)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:84)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:917)
at android.view.Choreographer.doCallbacks(Choreographer.java:710)
at android.view.Choreographer.doFrame(Choreographer.java:642)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:905)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5582)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Done using below but not yet got any solution,
_rm -rf node_modules && rm -rf /tmp/metro-bundler-cache- && rm -rf /tmp/haste-map-react-native-packager-* && npm install && react-native start --reset-cache_

also done
_cd android/ && ./gradlew clean && cd .. && react-native run-android_

Snack, code example, screenshot, or link to a repository:

Bug Stale

Most helpful comment

I solved it by adding error.message instead of error object

.catch((error) => {
               console.log(error)
            })

to

.catch((error) => {
               console.log(error.message)
            })

All 10 comments

I was seeing a similar error and disabling hermes fixed it for me.

Hi I'm experiencing the same error. Do you know at what point of the code does it happen?

I am facing same issue in react-native : 0.59.9 and react:16.8.3

Do you know why it is happen and any solution for this.

I am getting the same issue with
"react": "16.9.0",
"react-native": "0.61.4"

I am getting the same error... I think it is caused by the axios...

I solved it by adding error.message instead of error object

.catch((error) => {
               console.log(error)
            })

to

.catch((error) => {
               console.log(error.message)
            })

Try to use

.then((result) => console.log(result))
.catch((erorr) => console.log(error.message))

methods to prevent such errors.

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

Was this page helpful?
0 / 5 - 0 ratings