解决Flutter运行报错Could not run build/ios/iphoneos/Runner.app

简介: 解决Flutter运行报错Could not run build/ios/iphoneos/Runner.app

错误场景

更新了IOS的系统版本为最新的17.0, 运行报以下错误

Launching lib/main.dart on iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: GN3DCAF71C
Running Xcode build...
Xcode build done.                                           10.3s
Installing and launching...
Could not run build/ios/iphoneos/Runner.app on 00008101-000465E821FA001E.
Try launching Xcode and selecting "Product > Run" to fix the problem:
  open ios/Runner.xcworkspace

Error launching application on iPhone.

网上的解决方案

在网上上到一种方法

1. run "flutter clean" on flutter project
2. in xcode -> build -> clean
3. run "flutter build bundle"

试一下发现不是一样的问题。

实际解决方案

最后在stackoverflow上找到解决办法=>链接地址

根本原因是IOS17和Xcode的配置变化引起的,需要更新Flutter的SDK版本到3.13以上就可以解决。

在命令行中使用flutter upgrade来更新Flutter sdk。

ado@adodeMacBook-Air ~ % flutter upgrade
Upgrading Flutter to 3.16.2 from 3.10.6 in
/Users/ado/work/dev_env/flutter...
Downloading Darwin arm64 Dart SDK from Flutter engine cf7a9d0800f2a5da166dbe0eb9fb2476018269b1...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  2  207M    2 4399k    0     0  7378k      0  0:00:28 --:--:--  0:00:28 7419k
  6  207M    6 14.1M    0     0  9174k      0  0:00:23  0:00:01  0:00:22 9193k
 11  207M   11 23.9M    0     0  9507k      0  0:00:22  0:00:02  0:00:20 9517k
 16  207M   16 34.4M    0     0  9889k      0  0:00:21  0:00:03  0:00:18 9898k
 21  207M   21 44.0M    0     0  9869k      0  0:00:21  0:00:04  0:00:17 9875k
 26  207M   26 54.3M    0     0  9966k      0  0:00:21  0:00:05  0:00:16 10.0M
 31  207M   31 64.5M    0     0   9.7M      0  0:00:21  0:00:06  0:00:15 10.0M
 36  207M   36 74.8M    0     0   9.8M      0  0:00:20  0:00:07  0:00:13 10.1M
 41  207M   41 85.0M    0     0   9.8M      0  0:00:20  0:00:08  0:00:12 10.0M
 45  207M   45 94.7M    0     0   9.9M      0  0:00:20  0:00:09  0:00:11 10.1M
 50  207M   50  104M    0     0   9.8M      0  0:00:21  0:00:10  0:00:11  9.9M
 55  207M   55  113M    0     0   9.8M      0  0:00:21  0:00:11  0:00:10  9.8M
 59  207M   59  123M    0     0   9.8M      0  0:00:21  0:00:12  0:00:09 9913k
 64  207M   64  132M    0     0   9.7M      0  0:00:21  0:00:13  0:00:08 9804k
 68  207M   68  140M    0     0  9899k      0  0:00:21  0:00:14  0:00:07 9436k
 72  207M   72  150M    0     0  9906k      0  0:00:21  0:00:15  0:00:06 9544k
 77  207M   77  159M    0     0  9872k      0  0:00:21  0:00:16  0:00:05 9408k
 81  207M   81  169M    0     0  9862k      0  0:00:21  0:00:17  0:00:04 9421k
 86  207M   86  178M    0     0  9843k      0  0:00:21  0:00:18  0:00:03 9388k
 90  207M   90  188M    0     0  9826k      0  0:00:21  0:00:19  0:00:02 9616k
 94  207M   94  195M    0     0  9721k      0  0:00:21  0:00:20  0:00:01 9142k
 97  207M   97  202M    0     0  9611k      0  0:00:22  0:00:21  0:00:01 8745k
100  207M  100  207M    0     0  9609k      0  0:00:22  0:00:22 --:--:-- 8611k
Building flutter tool...
Resolving dependencies...
Got dependencies.

Upgrading engine...
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Downloading android-arm-profile/darwin-x64 tools...                422ms
Downloading android-arm-release/darwin-x64 tools...                437ms
Downloading android-arm64-profile/darwin-x64 tools...              323ms
Downloading android-arm64-release/darwin-x64 tools...              504ms
Downloading android-x64-profile/darwin-x64 tools...                309ms
Downloading android-x64-release/darwin-x64 tools...                284ms
Downloading android-x86 tools...                                 1,292ms
Downloading android-x64 tools...                                 1,850ms
Downloading android-arm tools...                                 1,238ms
Downloading android-arm-profile tools...                           806ms
Downloading android-arm-release tools...                           536ms
Downloading android-arm64 tools...                                  6.9s
Downloading android-arm64-profile tools...                         837ms
Downloading android-arm64-release tools...                         631ms
Downloading android-x64-profile tools...                           868ms
Downloading android-x64-release tools...                           528ms
Downloading android-x86-jit-release tools...                     1,362ms
Downloading ios tools...                                            9.1s
Downloading ios-profile tools...                                    8.9s
Downloading ios-release tools...                                    6.1s
Downloading Web SDK...                                              5.8s
Downloading package sky_engine...                                  141ms
Downloading flutter_patched_sdk tools...                           426ms
Downloading flutter_patched_sdk_product tools...                   392ms
Downloading darwin-arm64 tools...                                2,841ms
Downloading darwin-x64/FlutterMacOS.framework tools...              3.2s
Downloading darwin-x64/gen_snapshot tools...                       618ms
Downloading darwin-x64-profile/FlutterMacOS.framework tools...      1,642ms
Downloading darwin-x64-profile tools...                            302ms
Downloading darwin-x64-profile/gen_snapshot tools...               610ms
Downloading darwin-x64-release/FlutterMacOS.framework tools...      1,102ms
Downloading darwin-x64-release tools...                            277ms
Downloading darwin-x64-release/gen_snapshot tools...               547ms
Downloading darwin-arm64/font-subset tools...                      165ms

Flutter 3.16.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 9e1c857886 (14 hours ago) • 2023-11-30 11:51:18 -0600
Engine • revision cf7a9d0800
Tools • Dart 3.2.2 • DevTools 2.28.3

Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.2, on macOS 14.1.2 23B92 darwin-arm64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.84.1)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!


等待更新完成后,flutter doctor中没有提示其他错误了,直接run就能正常了。

相关文章
|
2月前
【Azure Logic App】使用Outlook.com发送邮件遇到429报错
【Azure Logic App】使用Outlook.com发送邮件遇到429报错
|
2月前
|
开发工具 git
【Azure App Service】App Service设置访问限制后,使用git clone代码库出现403报错
【Azure App Service】App Service设置访问限制后,使用git clone代码库出现403报错
|
2月前
|
开发框架 .NET Windows
【App Service】在App Service中配置Virtual applications and directories,访问目录中的静态文件报错404
【App Service】在App Service中配置Virtual applications and directories,访问目录中的静态文件报错404
|
2月前
|
缓存
【Azure Function】Function App代码中使用Managed Identity认证获取Blob数据时遇见400报错
【Azure Function】Function App代码中使用Managed Identity认证获取Blob数据时遇见400报错
【Azure Function】Function App代码中使用Managed Identity认证获取Blob数据时遇见400报错
|
2月前
|
JavaScript API
Vue3 运行可以,build 打包发布报错,app.config.globalProperties 用法坑
Vue3 运行可以,build 打包发布报错,app.config.globalProperties 用法坑
50 2
|
2月前
|
XML 安全 Android开发
Flutter配置Android和IOS允许http访问
Flutter配置Android和IOS允许http访问
69 3
|
2月前
|
iOS开发
App备案与iOS云管理式证书 ,公钥及证书SHA-1指纹的获取方法
App备案与iOS云管理式证书 ,公钥及证书SHA-1指纹的获取方法
120 0
App备案与iOS云管理式证书 ,公钥及证书SHA-1指纹的获取方法
|
2月前
|
Android开发 iOS开发 C#
Xamarin:用C#打造跨平台移动应用的终极利器——从零开始构建你的第一个iOS与Android通用App,体验前所未有的高效与便捷开发之旅
【8月更文挑战第31天】Xamarin 是一个强大的框架,允许开发者使用单一的 C# 代码库构建高性能的原生移动应用,支持 iOS、Android 和 Windows 平台。作为微软的一部分,Xamarin 充分利用了 .NET 框架的强大功能,提供了丰富的 API 和工具集,简化了跨平台移动应用开发。本文通过一个简单的示例应用介绍了如何使用 Xamarin.Forms 快速创建跨平台应用,包括设置开发环境、定义用户界面和实现按钮点击事件处理逻辑。这个示例展示了 Xamarin.Forms 的基本功能,帮助开发者提高开发效率并实现一致的用户体验。
96 0
|
2月前
|
安全 前端开发 网络安全
【Azure App Service】访问App Service应用报错 SSL: WRONG_VERSION_NUMBER
【Azure App Service】访问App Service应用报错 SSL: WRONG_VERSION_NUMBER
100 0
|
2月前
|
Shell PHP Windows
【Azure App Service】Web Job 报错 UNC paths are not supported. Defaulting to Windows directory.
【Azure App Service】Web Job 报错 UNC paths are not supported. Defaulting to Windows directory.