ios - 无法为 iOS 构建应用程序,“无法写入模块会话文件 Session.modulevalidation 没有这样的文件或目录”
问题描述
昨天我在 Flutter 上工作得很好,现在我正面临这个问题,我已经到处寻找解决方案,但没有成功。
当我运行时:
flutter run
构建过程开始,当它即将完成时,显示以下错误:
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Xcode build done. 12.3s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
error: unable to write module session file at '/Users/hencke/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation': fopen(/Users/hencke/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation, wb): No such file or directory (2)
note: Using new build system
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.
Exited (sigterm)
看起来该进程正在尝试打开此文件Session.modulevalidation
进行写入,但该文件夹中确实不存在此文件。而且我不知道该怎么办。
我已经尝试过的事情:
- 重新安装 xcode
- 扑干净
- 在另一个文件夹中再次克隆我的项目并尝试构建,但同样的错误
- 创建了一个新的颤振虚拟项目并尝试构建,仍然是同样的错误
- 多次重启机器
- 授予员工对
DerivedData
和ModuleCache.noindex
文件夹的权限 - 删除了
DerivedData
希望 xcode build 将重新创建所需的所有文件,但是,它再次创建了所有内容,但没有创建该特定文件。
就是这样,如果任何有福的人知道如何“重新创建”,或重置,清除一些缓存,我将非常感激。
解决方案
在运行项目之前,请检查运行时是否检查了所有内容:
flutter doctor
并确保至少连接了一个设备或首先打开 iOS 模拟器。您可以通过以下方式检查flutter是否成功连接到设备:
flutter devices
当您确保颤振检测到您的设备或模拟器时,然后通过以下方式运行您的应用程序:
flutter run
推荐阅读
- c# - WPF 错误:运算符“<=”不能应用于“对象”和“对象”类型的操作数
- sql - 如何防止 PostgreSQL 舍入双精度值的输出?
- amazon-ec2 - 如何使用 terraform 自动缩放创建 AWS A 记录
- ios - 出现自定义侧菜单时如何隐藏状态栏的一部分
- swift - 在 Swift 中使用 DI 时避免使用胖初始化器
- vue.js - Vue.js,如何将 v-model 与数据数组一起使用?
- oracle - 通过自动化作业在 Oracle SQL Developer 中“导出数据库”
- scala - 从 Flink REPL 使用 Google Storage
- javascript - 在我的主机中加载 3d 模型时出现问题
- java - 如何使用 NetBeans 解决生成代码中的合并冲突?