使用模拟器时执行flutter run 报出下面一大堆错误 注意只有模拟器有这种问题,真机可以正常运行

Oops; flutter has exited unexpectedly.
Sending crash report to Google.
Crash report sent (report ID: 1f4909d52a4fc2ef)
Crash report written to /Users/admin/Tiny/Project/Git/YinHuYiTou/yhyt_app/flutter_21.log;
please let us know at https://github.com/flutter/flutter/issues.

定位到flutter_21.log

flutter run

## exception

ProcessException: ProcessException: Process "/usr/bin/xcrun" exited abnormally:
An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1):
This app could not be installed at this time.
Could not hardlink copy /Users/admin/Library/Developer/CoreSimulator/Devices/5D883DD5-5315-474D-8E19-9E08A9FB5B4D/data/Containers/Bundle/Application/B2B708AE-0740-4AF0-9766-C736BB51DAE6/Runner.app to /Users/admin/Library/Developer/CoreSimulator/Devices/5D883DD5-5315-474D-8E19-9E08A9FB5B4D/data/Library/Caches/com.apple.mobile.installd.staging/temp.8C1dZO/extracted/Payload/Runner.app with manifest /Users/admin/Library/Developer/CoreSimulator/Devices/5D883DD5-5315-474D-8E19-9E08A9FB5B4D/data/Library/Caches/com.apple.mobile.installd.staging/temp.8C1dZO/extracted/com.apple.deltainstallcommands.com.example.yhytApp
Could not hardlink copy /Users/admin/Library/Developer/CoreSimulator/Devices/5D883DD5-5315-474D-8E19-9E08A9FB5B4D/data/Containers/Bundle/Application/B2B708AE-0740-4AF0-9766-C736BB51DAE6/Runner.app to /Users/admin/Library/Developer/CoreSimulator/Devices/5D883DD5-5315-474D-8E19-9E08A9FB5B4D/data/Library/Caches/com.apple.mobile.installd.staging/temp.8C1dZO/extracted/Payload/Runner.app with manifest /Users/admin/Library/Developer/CoreSimulator/Devices/5D883DD5-5315-474D-8E19-9E08A9FB5B4D/data/Library/Caches/com.apple.mobile.installd.staging/temp.8C1dZO/extracted/com.apple.deltainstallcommands.com.example.yhytApp
Underlying error (domain=MIInstallerErrorDomain, code=8):
Could not hardlink copy /Users/admin/Library/Developer/CoreSimulator/Devices/5D883DD5-5315-474D-8E19-9E08A9FB5B4D/data/Containers/Bundle/Application/B2B708AE-0740-4AF0-9766-C736BB51DAE6/Runner.app to /Users/admin/Library/Developer/CoreSimulator/Devices/5D883DD5-5315-474D-8E19-9E08A9FB5B4D/data/Library/Caches/com.apple.mobile.installd.staging/temp.8C1dZO/extracted/Payload/Runner.app with manifest /Users/admin/Library/Developer/CoreSimulator/Devices/5D883DD5-5315-474D-8E19-9E08A9FB5B4D/data/Library/Caches/com.apple.mobile.installd.staging/temp.8C1dZO/extracted/com.apple.deltainstallcommands.com.example.yhytApp
Command: /usr/bin/xcrun simctl install 5D883DD5-5315-474D-8E19-9E08A9FB5B4D /Users/admin/Tiny/Project/Git/YinHuYiTou/yhyt_app/build/ios/iphonesimulator/Runner.app

找到问题

Could not hardlink copy /Users/admin/Library/Developer/CoreSimulator/Devices

解决问题:

原来是在flutter中设置pubspec.yaml配置文件的时候有一个版本号的设置version: 1.0.0,问题就出在了这里,在iOS中有一个build号的概念,这里默认通过version: 1.0.0+n,通过+n,n代表build号,如果把+n去掉,那么在xcode工程中就没办法获取到build号,build那一行就为空,所有千万不要把+n去掉,

添加上了+n之后,把模拟器上面app先删除掉,再重新安装,即可解决问题

version: 1.0.0+1

参考来源 https://stackoverflow.com/a/45718538

flutter Oops; flutter has exited unexpectedly的更多相关文章

  1. The FastCGI process exited unexpectedly

    ERROR:HTTP Error 500.0 - Internal Server Error D:\Program Files\php\php-cgi.exe - The FastCGI proces ...

  2. Flutter介绍 - Flutter,H5,React Native之间的对比

    Flutter介绍 Flutter是Google推出的开源移动应用开发框架.开发者可以通过开发一套代码同时运行在iOS和Android平台. 它使用Dart语言进行开发,并且最终编译成各个平台的Nat ...

  3. sublime插件不能使用,提示plugin_host has exited unexpectedly

    sublime Text3一打开软件就提示plugin_host has exited unexpectedly,插件不能使用 解决方法很简单: 1.首先,ctrl + shift + p  --&g ...

  4. 【Flutter】Flutter 一些常用库

    Flutter社区和资源传送门 新: 慕课网<Flutter入门与案例实战>   |   中文网<Flutter实战>电子书 字体图标生成 http://fluttericon ...

  5. 【Mac + Appium】之运行报错:[UiAutomator] UiAutomator exited unexpectedly with code 0, signal null

    产生下面的原因是因为:与uiautomator2的weditor冲突,两者不能同时使用. 有时打开appium时会报错: [UiAutomator] UiAutomator exited unexpe ...

  6. spark利用yarn提交任务报:YARN application has exited unexpectedly with state UNDEFINED

    spark用yarn提交任务会报ERROR cluster.YarnClientSchedulerBackend: YARN application has exited unexpectedly w ...

  7. appium + python 自动化调试手机时 UiAutomator exited unexpectedly with code 0, signal null

    放上appium报错图,appium在手机里安装了appium setting 和unlock 软件,输入法也被变成了appium input ,但是就是点不到目标软件,手机也可以被cmd  adb ...

  8. 【手把手学习flutter】Flutter打Android包的基本配置和包体积优化策略

    [手把手学习flutter]Flutter打Android包的基本配置和包体积优化策略 关注「松宝写代码」,回复"加群" 加入我们一起学习,天天向上 前言 因为最近参加2020FE ...

  9. Flutter framework & Flutter basics

    Flutter framework & Flutter basics https://flutter.dev/docs/get-started/learn-more UI widgets ht ...

随机推荐

  1. CPU排行

    早期的时候,在某个网站上面收录下来的关于CPU排行的信息,发出来让更多的人看到,希望能够帮助到一些人!

  2. 第八章 watch监听 86 watch、computed、methods的对比

  3. Web界面开发必看!Kendo UI for jQuery编辑功能指南第一弹

    Kendo UI for jQuery最新试用版下载 Kendo UI目前最新提供Kendo UI for jQuery.Kendo UI for Angular.Kendo UI Support f ...

  4. Vue习题作业练习

    作业一: 用table表格标签渲染以上数据,表格第一列是学生总分排名,最后一列是学生总分 <!DOCTYPE html> <html lang="en"> ...

  5. 箭头函数中可改变this作用域,回调函数用箭头函数this指向page,自定义事件用箭头函数this指向undefined

    1.回调函数中,用箭头函数改变this的作用域 success: (res)=>{ this.setData({ //此时,this指向page页面 ... }) } 2.自定义事件中,如果使用 ...

  6. django之ORM的查询优化、Ajax 06

    目录 ORM查询优化 only与defer select_related与prefetch_related查询优化 choices参数 MTV与MVC模型 Ajax简介 AJAX常见应用情景 AJAX ...

  7. WTL自定义控件:edit内容改变响应

    头文件内容: BEGIN_MSG_MAP(myEdit) COMMAND_CODE_HANDLER_EX(EN_CHANGE, OnEnChange) END_MSG_MAP()4 void OnEn ...

  8. mybatis-动态sql-trim、where、set

    1. where标签的作用:如果该标签包含的元素中有返回值,就插入一个where:如果where后面的字符是以AND和OR开头的,就讲他们剔除. int findUserByWhere(@Param( ...

  9. node简单起服务

    1.建一个app.js文件 const http = require('http'); const chalk = require('chalk'); const conf = require('./ ...

  10. C#静态变量 总结

    在C#程序中,没有全局变量的概念,这意味着所有的成员变量只有该类的实例才能操作这些数据,这起到了“信息隐藏”的作用.但有些时候,这样做却不是个明智的选择. 假设我们要定义一个图书类,要求该类能保存图书 ...