【发布时间】:2020-03-02 15:48:36
【问题描述】:
在一个 react-native 项目中,我有一个 android_assets 文件夹中的压缩文件。我想解压缩此文件夹并将其复制到 DocumentDirectoryPath。我已经导入了 react-native-zip-archive 并使用了 unzipAssets,但它似乎不起作用。我使用了以下代码,但出现错误:“./ICF-Package”无法打开。
constassetPath = './ICF-Package.zip'
const targetPath = ${DocumentDirectoryPath}/ICF-Package.zip
copyfile() {
unzipAssets(assetPath, targetPath)
.then(() => {
console.log('unzip completed!')
})
.catch((error) => {
console.log(error)
})
}
【问题讨论】:
标签: react-native android-assets