Unable to execute operation dispatchViewManagerCommand on view with tag,since the view does not exit

React-Native 先打开一次自定义软键盘,然后取消软键盘,再次弹出,崩溃。(同一套代码,ios无问题,Android必现崩溃)

 报错日志如下:

E/unknown:React: Exception in native call
                                                                     com.facebook.react.uimanager.IllegalViewOperationException: Unable to execute operation dispatchViewManagerCommand on view with tag: 77, since the view does not exists
                                                                         at com.facebook.react.uimanager.UIImplementation.assertViewExists(UIImplementation.java:729)
                                                                         at com.facebook.react.uimanager.UIImplementation.dispatchViewManagerCommand(UIImplementation.java:613)
                                                                         at com.facebook.react.uimanager.UIManagerModule.dispatchViewManagerCommand(UIManagerModule.java:435)
                                                                         at java.lang.reflect.Method.invoke(Native Method)
                                                                         at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:319)
                                                                         at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158)
                                                                         at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
                                                                         at android.os.Handler.handleCallback(Handler.java:754)
                                                                         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:160)
                                                                         at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
                                                                         at java.lang.Thread.run(Thread.java:761)



乍一看,报错指向RN底层,无从下手。通过分析,报错说的是:无法对视图进行操作,因为view不存在。


就去看取消软键盘的操作,发现没有调用dismissKeyboard方法。于是加上下图这段,bug解决。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值