android - 如何在本机反应中将捆绑文件复制到文档目录
问题描述
我的包中有 json 文件。我想将文件复制到文档目录。
var path = RNFS.DocumentDirectoryPath + '/data.json';
RNFS.copyFile(`${RNFS.MainBundlePath}/assests/resource/data.json`, path)
.then(() => {
console.log('FILE COPIED');
})
.catch((err) => {
console.log(err.message);
});
The file “data.json” couldn’t be opened because there is no such file.
解决方案
推荐阅读
- php - Laravel 8:更新过程后如何重定向用户
- linux - “猫”是什么意思?Linux 运营商
- python - 一个描述符怎么可能没有 __get__ 和 __set__?
- android - 在视图模型中创建太多可变实时数据时的性能开销
- javascript - 如何在chartjs中将图例颜色框设置为折线图、条形图和饼图的线条?
- php - 使用 elequent 在同一时间 laravel 中将 id 保存在 diffrent 表上
- ios - 当应用程序未安装在我的 iPhone 上时,如何管理深层链接 URL?
- azure-keyvault - 从 key-vault (Cert) 在应用程序网关中添加 https 侦听器的 Azure CLI 命令是什么?
- javascript - Airbnb / 反应日期 | 有没有办法无限滚动几个月而不是点击下个月?
- selenium-webdriver - 使用 TestNg Cucumber 在 selenium 上获取 nullpointexception