2.0.7安卓使用jsb.fileUtils.removeDirectory无效。
模拟器可以删除,但是到安卓上就死活删不掉,求问还有啥删除方法
https://forum.cocos.com/t/topic/39566/8
this._storagePath = ((jsb.fileUtils ? jsb.fileUtils.getWritablePath() : “/”) + “remote-asset/”);
cc.log(this._storagePath);
if (jsb.fileUtils.isDirectoryExist(this._storagePath)) {
cc.log(“存在目录@@@”)
};
let flag = jsb.fileUtils.removeDirectory(this._storagePath);
cc.log("flag:: " + flag);
路径后加 “/” 也不行,isDirectoryExist返回是true,removeDirectory返回也是true,但就是删不掉,用adb shell查看还是存在 /data/data/org.cocos2d.testPro/files/remote-asset
我也在尝试解决这个问题
2.4.4模拟器测试了,用这个api无法删除目录