react-native - [object] is not usable as a native method argument - react-native

I recently started to get this error for both iOS and Android. I don't know what is causing this problem. In all the other instances of this error, there is probably a NaN value or some other unexpected value but in my case, everything is a valid value. For iOS, this is happening when I am callind the PushNotificationIOS.scheduleNotification. For Android, it happens, when I called a native react method.
This is only happening when I am running in dev mode. Please let me know what could be the problem here or how can I debug this problem.
2019-10-18 21:27:16.745 10843-11080/com.myapp E/ReactNativeJS: [{"fireDate":"2019-11-01T16:30:00.000Z","repeat":"2","repeatType":"weeks","creatorTimezone":"Asia/Kolkata","alarmId":"-LrU_OrkWvoCU-W8VY-A","alarmName":"Personal Reminder","type":"alarm","alarmType":"Personal","alarmDate":"2019-11-01T16:30:00.000Z","alarmAlert":"Personal Reminder - It's time.","shortAlarmAlert":"It's time.","cascadingAlarmInterval":900000,"recipientAlarmInterval":0,"alarmRingtone":{"label":"Hollywood Adventure","type":"inbuilt","value":"hollywood_adventure"},"vibrate":"true","volume":80,"version":2,"ringtoneDuration":60000,"uid":"-LrTbAdkCtVoFBfDKBwk","username":"udi","ringtonePath":"android.resource://com.myapp/raw/hollywood_adventure"}] is not usable as a native method argument
2019-10-18 21:27:16.766 10843-11080/com.myapp I/ReactNativeJS: 'Failed to print error: ', 'Exception in HostFunction: Malformed calls from JS: field sizes are different.\n\n[[34,45],[4,2],[["[{\\"fireDate\\":\\"2019-11-01T16:30:00.000Z\\",\\"repeat\\":\\"2\\",\\"repeatType\\":\\"weeks\\",\\"creatorTimezone\\":\\"Asia/Kolkata\\",\\"alarmId\\":\\"-LrU_OrkWvoCU-W8VY-A\\",\\"alarmName\\":\\"Personal Reminder\\",\\"type\\":\\"alarm\\",\\"alarmType\\":\\"Personal\\",\\"alarmDate\\":\\"2019-11-01T16:30:00.000Z\\",\\"alarmAlert\\":\\"Personal Reminder - It\'s time.\\",\\"shortAlarmAlert\\":\\"It\'s time.\\",\\"cascadingAlarmInterval\\":900000,\\"recipientAlarmInterval\\":0,\\"alarmRingtone\\":{\\"label\\":\\"Hollywood Adventure\\",\\"type\\":\\"inbuilt\\",\\"value\\":\\"hollywood_adventure\\"},\\"vibrate\\":\\"true\\",\\"volume\\":80,\\"version\\":2,\\"ringtoneDuration\\":60000,\\"uid\\":\\"-LrTbAdkCtVoFBfDKBwk\\",\\"username\\":\\"udi\\",\\"ringtonePath\\":\\"android.resource://com.myapp/raw/hollywood_adventure\\"}] is not usable as a native method argument",[{"column":20,"lineNumber":4382,"arguments":[],"methodName":"enqueueNativeCall","file":"http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&minify=false"},{"column":42,"lineNumber":4000,"arguments":[],"methodName":"fn","file":"http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&minify=false"},{"column":41,"lineNumber":284071,"arguments":[],"methodName":"scheduleNotification","file":"http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&minify=false"},{"column":53,"lineNumber":213975,"arguments":[],"methodName":"cancelOrRescheduleNotificationForAlarm","file":"http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&minify=false"},{"column":53,"lineNumber":213917,"arguments":[],"methodName":"markAlarmAsAcknowledged","file":"http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&minify=false"},{"column":17,"lineNumber":197088,"arguments":[],"methodName":"withConnectAndAuthenticationOptional","file":"http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&minify=false"},{"column":67,"lineNumber":213997,"arguments":[],"methodName":"onIAmUp","file":"http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&minify=false"},{"column":47,"lineNumber":53662,"arguments":[],"methodName":"touchableHandlePress","file":"http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&minify=false"},{"column":null,"lineNumber":null,"arguments":[],"methodName":"touchableHandlePress","file":"[native code]"},{"column":36,"lineNumber":53205,"arguments":[],"methodName":"_performSideEffectsForTransition","file":"http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&minify=false"},{"column":null,"lineNumber":null,"arguments":[],"methodName":"_performSideEffectsForTransition","file":"[native code]"},{"column":46,"lineNumber":53131,"arguments":[],"methodName":"_receiveSignal","file":"http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&minify=false"},{"column":null,"lineNumber":null,"arguments":[],"methodName":"_receiveSignal","file":"[native code]"},{"column":26,"lineNumber":53010,"arguments":[],"methodName":"touchableHandleResponderRelease","file":"http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&minify=false"},{"column":null,"lineNumber":null,"arguments":[],"methodName":"touchableHandleResponderRelease","file":"[native code]"},{"column":21,"lineNumber":14049,"arguments":[],"methodName":"invokeGuardedCallbackImpl","file":"http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&minify=false"},{"column":42,"lineNumber":14145,"arguments":[],"methodName":"invokeGuardedCallback","file":"http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&minify=false"},{"column":36,"lineNumber":14149,"arguments":[],"methodName":"invokeGuardedCallbackAndCatchFirstError","file":"http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&minify=false"},{"column":48,"lineNumber":14256,"arguments":[],"methodName":"executeDispatch","file":"http://10.0.2.2:8081/in
2019-10-18 21:27:16.770 10843-11080/com.myapp E/unknown:ReactNative: Exception in native call
java.lang.RuntimeException: Error calling RCTEventEmitter.receiveTouches
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:193)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:232)
at java.lang.Thread.run(Thread.java:764)
Caused by: com.facebook.jni.CppException: [{"fireDate":"2019-11-01T16:30:00.000Z","repeat":"2","repeatType":"weeks","creatorTimezone":"Asia/Kolkata","alarmId":"-LrU_OrkWvoCU-W8VY-A","alarmName":"Personal Reminder","type":"alarm","alarmType":"Personal","alarmDate":"2019-11-01T16:30:00.000Z","alarmAlert":"Personal Reminder - It's time.","shortAlarmAlert":"It's time.","cascadingAlarmInterval":900000,"recipientAlarmInterval":0,"alarmRingtone":{"label":"Hollywood Adventure","type":"inbuilt","value":"hollywood_adventure"},"vibrate":"true","volume":80,"version":2,"ringtoneDuration":60000,"uid":"-LrTbAdkCtVoFBfDKBwk","username":"udi","ringtonePath":"android.resource://com.myapp/raw/hollywood_adventure"}] is not usable as a native method argument

Related

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/messaging/FirebaseMessaging;

After integrating moengage sdk in android I'm facing this issue
implementation("com.moengage:moe-android-sdk:12.2.02")
Update
After adding dependency "firebase-messaging" to build-gradle I'm receiving new error
java.lang.AbstractMethodError: abstract method "void com.moengage.core.internal.inapp.InAppHandler.onResume(android.app.Activity)"
at com.moengage.core.internal.inapp.InAppManager.onResume$core_release(InAppManager.kt:102)
at com.moengage.core.internal.lifecycle.LifecycleManager.onActivityResumed$core_release(LifecycleManager.kt:147)
at com.moengage.core.internal.lifecycle.GlobalActivityLifecycleObserver.onActivityResumed(GlobalActivityLifecycleObserver.kt:40)
at android.app.Application.dispatchActivityResumed(Application.java:438)
at android.app.Activity.dispatchActivityResumed(Activity.java:1445)
at android.app.Activity.onResume(Activity.java:1984)
at androidx.fragment.app.FragmentActivity.onResume(FragmentActivity.java:434)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1456)

what is Fatal Exception: com.facebook.react.bridge.NoSuchKeyException: value issue?

I have a react native application in production and it is crashing. I have added crashlytics to the app which gave this crash report.
Fatal Exception: com.facebook.react.bridge.NoSuchKeyException: value
attaching full crash report.
Fatal Exception: com.facebook.react.bridge.NoSuchKeyException: value
at com.facebook.react.bridge.ReadableNativeMap.getValue(ReadableNativeMap.java:109)
at com.facebook.react.bridge.ReadableNativeMap.getValue(ReadableNativeMap.java:113)
at com.facebook.react.bridge.ReadableNativeMap.getDouble(ReadableNativeMap.java:150)
at com.facebook.react.animated.ValueAnimatedNode.<init>(ValueAnimatedNode.java:27)
at com.facebook.react.animated.NativeAnimatedNodesManager.createAnimatedNode(NativeAnimatedNodesManager.java:85)
at com.facebook.react.animated.NativeAnimatedModule$4.execute(NativeAnimatedModule.java:208)
at com.facebook.react.animated.NativeAnimatedModule$3.execute(NativeAnimatedModule.java:154)
at com.facebook.react.uimanager.UIViewOperationQueue$UIBlockOperation.execute(UIViewOperationQueue.java:498)
at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:779)
at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:888)
at com.facebook.react.uimanager.UIViewOperationQueue.access$2200(UIViewOperationQueue.java:42)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:948)
at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:28)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:174)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:84)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:997)
at android.view.Choreographer.doCallbacks(Choreographer.java:797)
at android.view.Choreographer.doFrame(Choreographer.java:728)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:984)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8016)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)

React-native Android:Error while updating property 'allowFontScaling' in shadow node of type: RCTText

We found a serious problem.
When we loaded two jsbundles at the same time, the following Crash occurred.
I suspect that two threads are contributing to each other's resources.
Because the property's property is random.
The property that is reported.
React-native version: 0.46
com.facebook.react.bridge.JSApplicationIllegalArgumentException: Error while updating property 'allowFontScaling' in shadow node of type: RCTText
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:113)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty(ViewManagerPropertyUpdater.java:154)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:58)
at com.facebook.react.uimanager.ReactShadowNodeImpl.updateProperties(ReactShadowNodeImpl.java:298)
at com.facebook.react.uimanager.UIImplementation.createView(UIImplementation.java:289)
at com.facebook.react.uimanager.UIManagerModule.createView(UIManagerModule.java:364)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:374)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:162)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
at android.os.Looper.loop(Looper.java:154)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194)
at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.IllegalArgumentException: method com.facebook.react.views.text.ReactBaseTextShadowNode.setAllowFontScaling argument 1 has type boolean, got null
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:102)
... 15 more
Who has encountered this kind of mistake?

Not much meaningful crash reports from app in production. How to deal with them

We have an app in production and many of the errors from the crash reports (we use Sentry and BugSnag) are not very meaningful and hard to find/reproduce. How should we deal with them? Most of the time they look like as an internal errors in the iOS/Android (at least from the reports) and don't point to something which we have done wrong in the React Native part. Let's give you an example:
NullPointerExceptioncom.facebook.react.uimanager.NativeViewHierarchyManager in dropView - Attempt to invoke virtual method 'int android.view.View.getId()' on a null object reference.
The raw output of this error is:
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getId()' on a null object reference
at com.facebook.react.uimanager.NativeViewHierarchyManager.dropView(NativeViewHierarchyManager.java:532)
at com.facebook.react.uimanager.NativeViewHierarchyManager.manageChildren(NativeViewHierarchyManager.java:424)
at com.facebook.react.uimanager.UIViewOperationQueue$ManageChildrenOperation.execute(UIViewOperationQueue.java:179)
at com.facebook.react.uimanager.UIViewOperationQueue$2.run(UIViewOperationQueue.java:787)
at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:843)
at com.facebook.react.uimanager.UIViewOperationQueue.access$1600(UIViewOperationQueue.java:48)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:889)
at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:31)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:129)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:107)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:909)
at android.view.Choreographer.doCallbacks(Choreographer.java:723)
at android.view.Choreographer.doFrame(Choreographer.java:655)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
This started to become very annoying because of the time spent on them without any useful results.

Upgrade react native from 0.12 to 0.15 got null pointer error

I tried to upgrade react native on android from 0.12 to 0.15,but I got a nullpointerException when I start my app.
Is there any break up changes?Do I need to change my code?
java.lang.NullPointerException: java.lang.NullPointerException
at android.widget.TextView.checkForRelayout(TextView.java:7074)
at android.widget.TextView.setText(TextView.java:3976)
at android.widget.TextView.setText(TextView.java:3813)
at android.widget.TextView.setText(TextView.java:3788)
at com.facebook.react.views.text.ReactTextViewManager.updateExtraData(ReactTextViewManager.java:85)
at com.facebook.react.views.text.ReactTextViewManager.updateExtraData(ReactTextViewManager.java:37)
at com.facebook.react.uimanager.NativeViewHierarchyManager.updateViewExtraData(NativeViewHierarchyManager.java:110)
at com.facebook.react.uimanager.UIViewOperationQueue$UpdateViewExtraData.execute(UIViewOperationQueue.java:183)
at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:574)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:622)
at com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32)
at com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:120)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:786)
at android.view.Choreographer.doCallbacks(Choreographer.java:591)
at android.view.Choreographer.doFrame(Choreographer.java:559)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:774)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5348)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
Any Idea to solve this problems?
In your project,open android/gradle/wrapper/gradle-wrapper.properties file,change last line distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip.
When I change the gradle version to gradle-2.2.1-all.zip, everything works fine.
If gradle-2.4-all.zip does not work,you can try replace other version,click here for more.