解决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就能正常了。

相关文章
|
5天前
|
开发框架 前端开发 Android开发
Flutter 与原生模块(Android 和 iOS)之间的通信机制,包括方法调用、事件传递等,分析了通信的必要性、主要方式、数据传递、性能优化及错误处理,并通过实际案例展示了其应用效果,展望了未来的发展趋势
本文深入探讨了 Flutter 与原生模块(Android 和 iOS)之间的通信机制,包括方法调用、事件传递等,分析了通信的必要性、主要方式、数据传递、性能优化及错误处理,并通过实际案例展示了其应用效果,展望了未来的发展趋势。这对于实现高效的跨平台移动应用开发具有重要指导意义。
33 4
|
1月前
|
JSON 小程序 JavaScript
uni-app开发微信小程序的报错[渲染层错误]排查及解决
uni-app开发微信小程序的报错[渲染层错误]排查及解决
549 7
|
18天前
|
存储 测试技术 Shell
Flutter UT太多导致跑覆盖率报错
Flutter UT太多导致跑覆盖率报错
25 2
|
24天前
|
C#
【Azure App Service】使用Microsoft.Office.Interop.Word来操作Word文档,部署到App Service后报错COMException
System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (0x80040154 (REGDB_E_CLASSNOTREG)).
|
1月前
|
移动开发 小程序 数据可视化
基于npm CLI脚手架的uniapp项目创建、运行与打包全攻略(微信小程序、H5、APP全覆盖)
基于npm CLI脚手架的uniapp项目创建、运行与打包全攻略(微信小程序、H5、APP全覆盖)
245 3
|
2月前
|
移动开发 Android开发 数据安全/隐私保护
移动应用与系统的技术演进:从开发到操作系统的全景解析随着智能手机和平板电脑的普及,移动应用(App)已成为人们日常生活中不可或缺的一部分。无论是社交、娱乐、购物还是办公,移动应用都扮演着重要的角色。而支撑这些应用运行的,正是功能强大且复杂的移动操作系统。本文将深入探讨移动应用的开发过程及其背后的操作系统机制,揭示这一领域的技术演进。
本文旨在提供关于移动应用与系统技术的全面概述,涵盖移动应用的开发生命周期、主要移动操作系统的特点以及它们之间的竞争关系。我们将探讨如何高效地开发移动应用,并分析iOS和Android两大主流操作系统的技术优势与局限。同时,本文还将讨论跨平台解决方案的兴起及其对移动开发领域的影响。通过这篇技术性文章,读者将获得对移动应用开发及操作系统深层理解的钥匙。
|
3月前
【Azure Logic App】使用Outlook.com发送邮件遇到429报错
【Azure Logic App】使用Outlook.com发送邮件遇到429报错
|
3月前
|
Java 容器
【Azure Function App】Java Function在运行中遇见内存不足的错误
【Azure Function App】Java Function在运行中遇见内存不足的错误
|
3月前
|
开发工具 git
【Azure App Service】App Service设置访问限制后,使用git clone代码库出现403报错
【Azure App Service】App Service设置访问限制后,使用git clone代码库出现403报错
|
3月前
|
开发框架 .NET Windows
【App Service】在App Service中配置Virtual applications and directories,访问目录中的静态文件报错404
【App Service】在App Service中配置Virtual applications and directories,访问目录中的静态文件报错404
下一篇
无影云桌面