我也遇到这种问题了,你解决了吗?
跪求帮助!真机udp socket无法使用?真机2.0安卓错误提示:error occurs:ENOENT: no such file or directory, access '/storage/emulated/0/Android/data/com.tencent.mm/MicroMsg/wxanewfiles/35f5af60466dfe67f146a6f2e0a7488f/miniprogramLog/log2' 真机1.0错误提示:errMsg: "send: fail sendUDPSocketMessage:fail:not supported" 模拟器可正常发送,预览和真机调试都失败 const udp = wx.createUDPSocket() console.log('udp:', udp) 源码(bind和connect都尝试过,全都不行): console.log("wx.canIUse("createUDPSocket"), wx.canIUse("UDPSocket.send")) #这两项打印都为true const udp = wx.createUDPSocket() udp.connect({address: '填的我自己电脑IP', port: 10000}) udp.write('hello, how are you') // udp.bind() // udp.send({ // address: '填的我自己电脑IP', // port: 10000, // message: 'hello, how are you' // }) [图片][图片]
2022-03-22