You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android 13下React Native无法打开DocumentDirectoryPath中的Zip文件

Android 13 - 系统特定问题

我已将Zip文件下载至DocumentDirectoryPath,但尝试多种方案均无法打开该文件,以下是试过的方法及遇到的问题:

方案1:使用React Native Linking工具

Linking是RN中用于打开文件管理器的工具,执行代码:

await Linking.openURL(`file://${zipFilePath}`, mimeType);

报错信息:Unable to open file manager for BineryDocument.zip,已确认文件确实存在。

方案2:使用react-native-intent-launcher包

该包下载量较低,执行代码:

await IntentLauncherAndroid.startActivity({
    action: IntentLauncherAndroid.ACTION_VIEW,
    data: 'file:///path/to/your/file',
    type: 'application/your-mime-type',
});

问题:无法打开目标Zip文件。

方案3:使用react-native-file-viewer包

执行代码:

try {
    await FileViewer.open(filePath, { showOpenWithDialog: true });
} catch (error) {
    console.error('Error opening file:', error);
}

问题:同样无法打开文件。

文件路径

/data/user/0/co.binery.app/files/BineryDocument.zip

内容的提问来源于stack exchange,提问作者Aamirkhan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.03 04:46:10