- 当前 Bug 的表现(可附上截图)
- 预期表现
- 复现路径
- 提供一个最简复现 Demo
let tempFilePath = cc.game.canvas.toTempFilePathSync({
x: 0,
y: 0,
width: 720,
height: 1280,
destWidth: 500,
destHeight: 400
});
cc.log(tempFilePath);
let fw = wx.getFileSystemManager();
let res = fw.copyFileSync(tempFilePath, `${wx.env.USER_DATA_PATH}/shotScreen.png`);
cc.log(res);
cc.log(`${wx.env.USER_DATA_PATH}/shotScreen.png`);
模拟器上log都有打印,res为空,其他有值
实机上(米max报错)
gameThirdScriptError
Uncaught Error: copyFileSync:fail no such file or directory, copyFile "bb1bbcd9-a33c-47bc-8043-254269810f84" -> "wxfile://usr/shotScreen.png"
Error: copyFileSync:fail no such file or directory, copyFile "bb1bbcd9-a33c-47bc-8043-254269810f84" -> "wxfile://usr/shotScreen.png"
at Object.ba [as copyFileSync] (WAGame.js:9:5122)
at a.emit (WAGame.js:7:13121)
at Tr.EventHandler.(anonymous function) (WAGame.js:11:24758)
at Object.<anonymous> (<anonymous>:133:17)
at <anonymous>:1:21
请问一下,这个问题有解决吗,后来是怎么实现的呢
你好,请提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。