我需要将文件夹从资产复制到文档
此代码适用于ios
const preInstallPath = `${RNFB.fs.dirs.MainBundleDir}/preinstalled-ads`;
const adsPath =`${RNFB.fs.dirs.DocumentDir}/ads`;
try{
await RNFB.fs.cp(preInstallPath,adsPath);
console.log('Copy pre ads finished ok');
return true;
}catch (e) {
console.log('Problem with copy pre ads: ',e);
return false;
}
我的问题是Android 当我尝试从资产中获取文件夹时,出现错误 例子
when I do this
await RNFB.fs.stat(RNFB.fs.asset('preinstalled-ads/5iy2xw/assets/gyN7hS4C.jpeg'));
i get file status
but when I try this
await RNFB.fs.stat(RNFB.fs.asset('preinstalled-ads/'));
I get error
Possible Unhandled Promise Rejection (id: 0):
Error: failed to stat path `bundle-assets://preinstalled-ads/` because it does not exist or it is not a folder
谁可以让该文件夹工作?