8***@qq.com
8***@qq.com
  • 发布:2022-06-07 10:19
  • 更新:2023-10-25 09:26
  • 阅读:890

#插件讨论# 【 安卓串口通信 Fvv-UniSerialPort - Fvv123 】这什么情况呀

分类:uni-app

Error: [JS Framework] Failed to receiveTasks, instance (5) is not available.
10:18:27.684 Error: [JS Framework] Failed to receiveTasks, instance (13) is not available.
10:18:27.716 Error: [JS Framework] Failed to receiveTasks, instance (1) is not available.
10:18:27.746 Error: [JS Framework] Failed to receiveTasks, instance (2) is not available.
10:18:27.777 Error: [JS Framework] Failed to receiveTasks, instance (2) is not available.
10:18:27.809 Error: [JS Framework] Failed to receiveTasks, instance (14) is not available.
10:18:27.840 Error: [JS Framework] Failed to receiveTasks, instance (17) is not available.
10:18:27.871 Error: [JS Framework] Failed to receiveTasks, instance (3) is not available.
10:18:27.904 Error: [JS Framework] Failed to receiveTasks, instance (4) is not available.

这什么情况呀

2022-06-07 10:19 负责人:无 分享
已邀请:
i***@hotmail.com

i***@hotmail.com

据说是刚写完代码就跑会这样,关了hbuilder重新跑就好了。
实测可行

zhiye1994

zhiye1994

我代码热更新,就会出现这个,后面用仿照串口插件用UTS插件写了这个,也会出现这个报错,解决思路:热更新后会进入页面生命周期onLaunch,在这里面进行对串口关闭,就不出现了,可能是因为Fvv-UniSerialPort 中SerialPortHelper是个单例对象,热更新后没有销毁,

public class UniSerialPort extends WXModule {  
   private SerialPortHelper serialPortHelper = new SerialPortHelper();  

   public UniSerialPort() {  
   }  
   @JSMethod(  
      uiThread = true  
   )  
   public void setPath(String port) {  
      this.serialPortHelper.setPort(port);  
   }  
}
1***@qq.com

1***@qq.com

这个问题后来有处理吗?觉得是在打开串口时,之前打开的串口没有正常关闭,又重新打开就会出现这个问题

要回复问题请先登录注册