React native:Error:Location ..... isn't movable
React native:Error:Location ..... isn't movable
我已经录制了一些音频文件,然后我试图将该音频文件移动到 folder.in 的默认路径,但出现错误,如错误:位置“'file:///data/data/host.exp.exponent/cache/ExperienceData/%40Fanonymous%2FCCameraApplication/filename.3gp'”不是活动。
如果有人遇到同样的问题,请告诉我。
但是我的默认路径 is:file:///data/data/host.exp.exponent/cache/ExperienceData/%2540anonymous%252FCCameraApplication/filename.3gp
这里附上我的示例代码。
const info = await FileSystem.getInfoAsync(this.recording.getURI());
console.log(`FILE INFO: ${JSON.stringify(info)}`);
const currentTime=Date.now();
await FileSystem.moveAsync({
from: `${JSON.stringify(info.uri)}`,
to: `${FileSystem.documentDirectory}audios/${currentTime}.3gp`,
});
Expo 的文件系统模块可以copy/move/etc。之前保存在应用程序范围内的文件(例如通过 ImagePicker 或使用 Asset.loadAsync)。 ImagerEditor 是 React Native 的核心功能,它将您的图像保存到 Expo 范围之外的文件中,因此 FileSystem 无法对该文件执行操作。现在更清楚了吗?
更多信息:https://forums.expo.io/t/where-does-camera-takepictureasync-save-photos/6475/7
我已经录制了一些音频文件,然后我试图将该音频文件移动到 folder.in 的默认路径,但出现错误,如错误:位置“'file:///data/data/host.exp.exponent/cache/ExperienceData/%40Fanonymous%2FCCameraApplication/filename.3gp'”不是活动。 如果有人遇到同样的问题,请告诉我。 但是我的默认路径 is:file:///data/data/host.exp.exponent/cache/ExperienceData/%2540anonymous%252FCCameraApplication/filename.3gp
这里附上我的示例代码。
const info = await FileSystem.getInfoAsync(this.recording.getURI());
console.log(`FILE INFO: ${JSON.stringify(info)}`);
const currentTime=Date.now();
await FileSystem.moveAsync({
from: `${JSON.stringify(info.uri)}`,
to: `${FileSystem.documentDirectory}audios/${currentTime}.3gp`,
});
Expo 的文件系统模块可以copy/move/etc。之前保存在应用程序范围内的文件(例如通过 ImagePicker 或使用 Asset.loadAsync)。 ImagerEditor 是 React Native 的核心功能,它将您的图像保存到 Expo 范围之外的文件中,因此 FileSystem 无法对该文件执行操作。现在更清楚了吗?
更多信息:https://forums.expo.io/t/where-does-camera-takepictureasync-save-photos/6475/7