【发布时间】:2021-04-01 13:45:52
【问题描述】:
static Future<String> init() async {
var installPath = "/Users/purplecity/code/likai_flutter/beiwanglu";
Directory notePath = Directory("${installPath}/NoteStorage/");
var noteDir = await notePath.exists();
if (!noteDir) {
await notePath.create();
}
在 Flutter Device:ios 模拟器上没问题。但是在 Device:Android-x86 模拟器它有错误
我需要做什么?我不想使用资产.. 只是读取本地文件...
Error:
FileSystemException (FileSystemException: Creation failed, path = '/Users/purplecity/Library/Android/sdk/NoteStorage/' (OS Error: No such file or directory, errno = 2))
【问题讨论】:
-
您在哪个 Android 版本上测试了该应用,而此
/Users/purplecity/code/likai_flutter/beiwanglu不是有效的存储路径。
标签: flutter