在一个本机反应项目中,我在android_assets文件夹中有一个压缩文件。我想解压缩该文件夹并将其复制到DocumentDirectoryPath中。我已经导入了react-native-zip-archive并使用了unzipAssets,但是它似乎不起作用。我使用了以下代码,但出现错误:无法打开“ ./ICF-Package”。
const assetPath ='./ICF-Package.zip'
const targetPath = ${DocumentDirectoryPath}/ICF-Package.zip
copyfile() {
unzipAssets(assetPath,targetPath)
.then(() => {
console.log('unzip completed!')
})
.catch((error) => {
console.log(error)
})
}